1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,6 +160,8 @@ export async function processPastedHtml(html: string) {
const createdResource = await shim.createResourceFromPath(imageFilePath); const createdResource = await shim.createResourceFromPath(imageFilePath);
mappedResources[imageSrc] = `file://${encodeURI(Resource.fullPath(createdResource))}`; mappedResources[imageSrc] = `file://${encodeURI(Resource.fullPath(createdResource))}`;
} }
} else if (imageSrc.startsWith('data:')) { // Data URIs
mappedResources[imageSrc] = imageSrc;
} else { } else {
const filePath = `${Setting.value('tempDir')}/${md5(Date.now() + Math.random())}`; const filePath = `${Setting.value('tempDir')}/${md5(Date.now() + Math.random())}`;
await shim.fetchBlob(imageSrc, { path: filePath }); await shim.fetchBlob(imageSrc, { path: filePath });