1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +02:00

Chore: Desktop: Fixes #8572: Fix warning when pasting images with data URI srcs (#8574)

This commit is contained in:
Henry Heino
2023-07-29 08:31:36 -07:00
committed by GitHub
parent 31f8e725dd
commit 7140675181

View File

@@ -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 });