From 9665e872c2716bf5701c4f555f0eed1bcc50f4fe Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 3 Oct 2023 09:40:31 +0200 Subject: [PATCH] fix importing inline images within markdown within zip, closes #4301 --- src/services/import/zip.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/import/zip.js b/src/services/import/zip.js index 010a10346..fcdb0cb5b 100644 --- a/src/services/import/zip.js +++ b/src/services/import/zip.js @@ -327,6 +327,11 @@ async function importZip(taskContext, fileBuffer, importRootNote) { content = content.replace(/<\/body>.*<\/html>/gis, ""); content = content.replace(/src="([^"]*)"/g, (match, url) => { + if (url.startsWith("data:image")) { + // inline images are parsed and saved into attachments in the note service + return match; + } + try { url = decodeURIComponent(url).trim(); } catch (e) {