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

Image attachment not shown when title of markdown file contains '#' #4156

Closed
jmechnich opened this issue Apr 29, 2023 · 4 comments · Fixed by #4488
Closed

Image attachment not shown when title of markdown file contains '#' #4156

jmechnich opened this issue Apr 29, 2023 · 4 comments · Fixed by #4488
Assignees
Labels
2. developing bug Something isn't working

Comments

@jmechnich
Copy link

jmechnich commented Apr 29, 2023

Describe the bug
When the name/title of a page contains a '#' character, image attachments cannot be loaded after saving.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new markdown file containing a '#' in its title/name
  2. Attach an image, e.g. by pasting one from the clipboard
  3. The image is displayed while still editing the file
  4. Click the 'Done' button
  5. The image is replaced by a 404 error box

Expected behavior
The image should be displayed all the time.

Screenshots

Create page containing '#' in name:
image

View after saving image:
image

View after replacing '#' with 'No.' and reloading/reselecting the page
image

From the developer tool in Firefox I gathered the following:
The Image loaded by collective-main.js contains an unescaped '#' character:
[redacted]/Collectives/Instruments/Guitars/Heritage%2025th%20Anniversary%20C150%20#16%20(02-22-2010)/.attachments.460129/image.png

Client details:

  • OS: macOS 13.2
  • Browser: Firefox
  • Version: 112.0.2
  • Device: MacBook Air
Server details

Collectives app version: 2.4.0

Operating system: Debian bullseye

Web server: nginx

Database: mariadb

PHP version: 8.2

Nextcloud version: 26.0.1

I don't think that any further logs should be required but I am happy to deliver them in case they are.

@jmechnich jmechnich added the bug Something isn't working label Apr 29, 2023
@mejo-
Copy link
Member

mejo- commented May 8, 2023

Dear @jmechnich, thanks a lot for the report. I was able to reproduce it. It's actually a bug in nextcloud/text, so I'm transfering the issue there.

@mejo- mejo- transferred this issue from nextcloud/collectives May 8, 2023
@juliusknorr
Copy link
Member

@mejo- Any futher pointers on why this goes wrong? Seems to be only an issue in the read only editor.

@mejo-
Copy link
Member

mejo- commented Jun 7, 2023

As far as I tried to understand it, the problem is that with the readonly editor, we will request the file via DAV. And there, the # is not escaped in the filename when doing the request for some reason.

@mejo-
Copy link
Member

mejo- commented Jun 20, 2023

I guess the problem is #davUrl() of AttachmentResolver.js. At least the # character in src is not encoded there. But I didn't look further into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants