fix: light background with dark diagram theme when downloading SVG ([#1777](https://github.com/mermaid-js/mermaid-live-editor/issues/1777))

This commit is contained in:
PetrLaskevic
2025-08-21 20:04:28 +02:00
parent 6f26aec073
commit 2aaa2e872f
+2
View File
@@ -45,6 +45,8 @@
svg = getSvgElement();
}
svg.style.backgroundColor = `hsl(${window.getComputedStyle(document.body).getPropertyValue('--background')})`;
const svgString = svg.outerHTML
.replaceAll('<br>', '<br/>')
.replaceAll(/<img([^>]*)>/g, (m, g: string) => `<img ${g} />`);