From d1b01d28e6e0d76a914b17a8eca75b17322c9985 Mon Sep 17 00:00:00 2001 From: CuriousCorrelation <58817502+CuriousCorrelation@users.noreply.github.com> Date: Wed, 13 Jul 2022 13:29:17 +0530 Subject: [PATCH] fix: `svg+xml` image type ext not assigned properly (#3774) --- shared/editor/nodes/Image.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/editor/nodes/Image.tsx b/shared/editor/nodes/Image.tsx index 194da6ab3..0b37fc127 100644 --- a/shared/editor/nodes/Image.tsx +++ b/shared/editor/nodes/Image.tsx @@ -119,7 +119,7 @@ const downloadImageNode = async (node: ProsemirrorNode) => { const image = await fetch(node.attrs.src); const imageBlob = await image.blob(); const imageURL = URL.createObjectURL(imageBlob); - const extension = imageBlob.type.split("/")[1]; + const extension = imageBlob.type.split(/\/|\+/g)[1]; const potentialName = node.attrs.alt || "image"; // create a temporary link node and click it with our image data