From 7140675181d19eec0adf6024d9828992215c1332 Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Sat, 29 Jul 2023 08:31:36 -0700 Subject: [PATCH] Chore: Desktop: Fixes #8572: Fix warning when pasting images with data URI srcs (#8574) --- packages/app-desktop/gui/NoteEditor/utils/resourceHandling.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/app-desktop/gui/NoteEditor/utils/resourceHandling.ts b/packages/app-desktop/gui/NoteEditor/utils/resourceHandling.ts index 4f654de4995..51c5a868e26 100644 --- a/packages/app-desktop/gui/NoteEditor/utils/resourceHandling.ts +++ b/packages/app-desktop/gui/NoteEditor/utils/resourceHandling.ts @@ -160,6 +160,8 @@ export async function processPastedHtml(html: string) { const createdResource = await shim.createResourceFromPath(imageFilePath); mappedResources[imageSrc] = `file://${encodeURI(Resource.fullPath(createdResource))}`; } + } else if (imageSrc.startsWith('data:')) { // Data URIs + mappedResources[imageSrc] = imageSrc; } else { const filePath = `${Setting.value('tempDir')}/${md5(Date.now() + Math.random())}`; await shim.fetchBlob(imageSrc, { path: filePath });