Skip to content

Commit ddfe050

Browse files
committed
add bindFunctions support
1 parent c55ff49 commit ddfe050

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web_src/js/markdown/mermaid.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ export async function renderMermaid(els) {
1212
});
1313

1414
for (const el of els) {
15-
mermaidAPI.render(`mermaid-${random(12)}`, el.textContent, (svg) => {
15+
mermaidAPI.render(`mermaid-${random(12)}`, el.textContent, (svg, bindFunctions) => {
1616
const div = document.createElement('div');
1717
div.classList.add('mermaid-chart');
1818
div.innerHTML = svg;
19+
if (typeof bindFunctions === 'function') bindFunctions(div);
1920
el.closest('pre').replaceWith(div);
2021
});
2122
}

0 commit comments

Comments
 (0)