Skip to content

Commit

Permalink
correctly save attachment URL, #4566
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Jan 7, 2024
1 parent 4e549ba commit 894b08a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 894b08a

Please sign in to comment.