diff --git a/src/services/notes.js b/src/services/notes.js index aa7e0eb3e..52bf0c4d2 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; }