Skip to content

Build your personal knowledge base with Trilium Notes

unescape HTML before downloading images, #4566

zadamee608fcf46a2
diff --git a/src/services/notes.js b/src/services/notes.js
index 42b66cc4a0..8da31c6a9e 100644
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@ -519,7 +519,7 @@ function downloadImages(noteId, content) {
let imageMatch;
while (imageMatch = imageRe.exec(content)) {
- const url = imageMatch[1];
+ let url = imageMatch[1];
const inlineImageMatch = /^data:image\/[a-z]+;base64,/.exec(url);
if (inlineImageMatch) {
@@ -541,6 +541,8 @@ function downloadImages(noteId, content) {
continue;
}
+ url = utils.unescapeHtml(url);
+
if (url in imageUrlToAttachmentIdMapping) {
const attachment = becca.getAttachment(imageUrlToAttachmentIdMapping[url]);