Rich editor fails to load manually added embedded images
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 738
- Forks
- 162
- Avg merge
- 6h 2m
- Merged PRs (30d)
- 35
Description
Using the rich text editor on the Notes web interface displays "Failed to load" for (seemingly) any embedded image links that aren't created by the rich text editor.
I have been migrating users from Evernote to Nextcloud Notes. The migration tool by default stores media in a _resources/{note-title}.resources/ directory and uses the relative path for the image source in the markdown. At first I thought that something was breaking in the rich display when any media url starts with an underscore, however after further testing I can't get any embedded image link to work unless it's created by the rich text editor itself. Is something being written to the database to enable the display?
To verify I don't just have a syntax error, I've been validating that it works using a local markdown viewer.
Steps to reproduce
- Create note with an embedded image eg:

- The rich editor will display a generic image icon and message: "Failed to load _resources/note-title.resources/image_file.png"
- I even tried changing an existing embedded image that was saved to the standard
.attachments.xxxxxxdirectory. Renaming the directory to replace the first period with an underscore, and doing the same in the note markdown, results in the same issue of the image not displaying. - Also tried prepending the uri with
./to see if it was only the start of the string that caused the issue. But same result. - I then tried making them fit the subdirectory naming that is generated when you use the rich editor to embed an image:
.attachments.xxxxxxbut again same result. - I then tried a completely innocuous directory name
note-title - and finally no subdirectory
Expected behaviour
Relative image paths used in embedded image markdown should render in the rich text editor
Actual behaviour
None of these embedded image markdown links seem to work:

or with the underscore char escaped:

or creating a notes "standard" subdirectory:

no sub-directory at all:

Server
Please complete the following information.
- Notes app version: 4.8.1
- Nextcloud version: 27.1.3.2
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure in the Notes web interface with the relative image paths listed in the issue, then compare them with paths created by the rich text editor. Trace how those markdown image sources are loaded and verify that relative images render for the listed directory and no-directory cases without breaking existing attachments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100