Skip to content

Commit

Permalink
unescape HTML before downloading images, #4566
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Jan 7, 2024
1 parent 894b08a commit ee608fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -541,6 +541,8 @@ function downloadImages(noteId, content) {
continue;
}

url = utils.unescapeHtml(url);

if (url in imageUrlToAttachmentIdMapping) {
const attachment = becca.getAttachment(imageUrlToAttachmentIdMapping[url]);

Expand Down

0 comments on commit ee608fc

Please sign in to comment.