Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLs in heading do not work in readonly mode #3822

Closed
42ske opened this issue Jan 24, 2023 · 4 comments · Fixed by #3847
Closed

URLs in heading do not work in readonly mode #3822

42ske opened this issue Jan 24, 2023 · 4 comments · Fixed by #3847
Labels
bug Something isn't working discuss

Comments

@42ske
Copy link

42ske commented Jan 24, 2023

Describe the bug
URLs in headings do not work in read-only mode. If you click at them nothing happens. If you open the same file with write permissions in the Text-App via Files everything works as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Collectives
  2. Insert an URL an format it as heading (h1, h2, …)
  3. try to open the URL by clicking to it.
  4. error: nothing happens

Expected behavior
I would expect a new browser tab to be opened with the URL as it ist if you open it from within the Text-App.

Client details:

  • OS: macOS, iOS, iPadOS
  • Browser: Firefox, Safari
  • Version: latest versions of OS as well as Browser
  • Device: iMac M1, iPhone SE 2022, iPad Pro 11" 3rd generation
Server details

Collectives app version: (see Nextcloud apps page)
2.2.1

Operating system:
Web server:
Database:
PHP version:
reproduced the bug on different servers.

Nextcloud version: (see Nextcloud admin page)
25.0.3

@42ske 42ske added the bug Something isn't working label Jan 24, 2023
@mejo- mejo- transferred this issue from nextcloud/collectives Feb 23, 2023
@mejo-
Copy link
Member

mejo- commented Feb 23, 2023

This issue also exists in readonly shares of Text app, thus transfering it to nextcloud/text.

@mejo-
Copy link
Member

mejo- commented Feb 23, 2023

For some reason, pos here doesn't point to the marked link. If I increment pos by one in the debugger, the link is correctly extracted.

@mejo- mejo- changed the title URLs in heading do not work URLs in heading do not work in readonly mode Feb 23, 2023
@mejo-
Copy link
Member

mejo- commented Feb 28, 2023

The reason for this bug is that our heading anchor links span over the whole headline in readonly mode. That's why they overlay possible links in the heading.

So I see two options here:

a) Limit width of heading anchor to 1em in readonly mode - just as it's done in editable mode already.
b) Accept that links in headings don't work in readonly mode.

I'm in favour of option a. What do others think @susnux @max-nextcloud @juliushaertl? Also @jancborchardt and @nimishavijay?

@mejo- mejo- added the discuss label Feb 28, 2023
@susnux
Copy link
Contributor

susnux commented Feb 28, 2023

I am also in favor of option A: Users will not be disappointed by not working links in headers (as they can be added they should work).

mejo- added a commit that referenced this issue Feb 28, 2023
In readonly mode, the heading anchor links spanned the whole width so
far, overlaying potential links in headings.

Fixes: #3822

Signed-off-by: Jonas <jonas@freesources.org>
mejo- added a commit that referenced this issue Feb 28, 2023
In readonly mode, the heading anchor links spanned the whole width so
far, overlaying potential links in headings.

Fixes: #3822

Signed-off-by: Jonas <jonas@freesources.org>
backportbot-nextcloud bot pushed a commit that referenced this issue Feb 28, 2023
In readonly mode, the heading anchor links spanned the whole width so
far, overlaying potential links in headings.

Fixes: #3822

Signed-off-by: Jonas <jonas@freesources.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discuss
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants