We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62a09a2 commit 41e4c98Copy full SHA for 41e4c98
webview-ui/src/components/common/MermaidBlock.tsx
@@ -243,7 +243,12 @@ async function svgToPng(svgEl: SVGElement): Promise<string> {
243
244
const serializer = new XMLSerializer()
245
const svgString = serializer.serializeToString(svgClone)
246
- const svgDataUrl = "data:image/svg+xml;base64," + btoa(decodeURIComponent(encodeURIComponent(svgString)))
+
247
+ // Create a data URL directly
248
+ // First, ensure the SVG string is properly encoded
249
+ const encodedSvg = encodeURIComponent(svgString).replace(/'/g, "%27").replace(/"/g, "%22")
250
251
+ const svgDataUrl = `data:image/svg+xml;charset=utf-8,${encodedSvg}`
252
253
return new Promise((resolve, reject) => {
254
const img = new Image()
0 commit comments