fix: svg+xml image type ext not assigned properly (#3774)

This commit is contained in:
CuriousCorrelation
2022-07-13 13:29:17 +05:30
committed by GitHub
parent 973cfc3fa3
commit d1b01d28e6

View File

@@ -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