diff --git a/src/data/image.ts b/src/data/image.ts index 912a708433..1c1a0a9277 100644 --- a/src/data/image.ts +++ b/src/data/image.ts @@ -105,7 +105,9 @@ export const encodeSvgMetadata = async ({ text }: { text: string }) => { export const decodeSvgMetadata = async ({ svg }: { svg: string }) => { if (svg.includes(`payload-type:${MIME_TYPES.excalidraw}`)) { - const match = svg.match(/(.+?)/); + const match = svg.match( + /\s*(.+?)\s*/, + ); if (!match) { throw new Error("INVALID"); }