diff --git a/src/services/notes.js b/src/services/notes.js index c325bba9b..6e6bbfd76 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -636,6 +636,10 @@ function saveAttachments(note, content) { content = `${content.substr(0, attachmentMatch.index)}${title}${content.substr(attachmentMatch.index + attachmentMatch[0].length)}`; } + // removing absolute references to server to keep it working between instances, + // we also omit / at the beginning to keep the paths relative + content = content.replace(/src="[^"]*\/api\/attachments\//g, 'src="api/attachments/'); + return content; }