From 894b08a1b8debd76d78c8b475ed96e3db226183f Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 7 Jan 2024 23:51:38 +0100 Subject: [PATCH] correctly save attachment URL, #4566 --- src/services/notes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/notes.js b/src/services/notes.js index 7062d1aee..42b66cc4a 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -511,7 +511,7 @@ const downloadImagePromises = {}; function replaceUrl(content, url, attachment) { const quotedUrl = utils.quoteRegex(url); - return content.replace(new RegExp(`\\s+src=[\"']${quotedUrl}[\"']`, "ig"), ` src="api/attachments/${encodeURIComponent(attachment.title)}/image"`); + return content.replace(new RegExp(`\\s+src=[\"']${quotedUrl}[\"']`, "ig"), ` src="api/attachments/${attachment.attachmentId}/image/${encodeURIComponent(attachment.title)}"`); } function downloadImages(noteId, content) {