feat(markdown): add hover download buttons on rendered SVGs

Attach SVG and PNG (×2) download buttons to every rendered SVG (TikZ,
Mermaid, …) once post-render finishes. Exports always use the original
colors with a white background baked in, regardless of theme.
This commit is contained in:
Julien Calixte
2026-05-16 12:17:04 +02:00
parent f3708b2f9d
commit 9d1b6552cb
4 changed files with 203 additions and 6 deletions

View File

@@ -174,7 +174,7 @@ export const useShikiji = (): Promise<void> => {
let mermaidInitialized = false
export const runMermaid = (querySelector: string) => {
export const runMermaid = (querySelector: string): Promise<void> => {
if (!mermaidInitialized) {
mermaidInitialized = true
mermaid.initialize({
@@ -184,7 +184,7 @@ export const runMermaid = (querySelector: string) => {
})
}
mermaid.run({
return mermaid.run({
querySelector
})
}