Skip to content

Commit 96d7d0f

Browse files
fix: mermaid rendering with startOnLoad:false + explicit run()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3182957 commit 96d7d0f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

_includes/head-custom.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<script type="module">
22
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
3-
mermaid.initialize({ startOnLoad: true });
3+
mermaid.initialize({ startOnLoad: false });
44
document.querySelectorAll('pre > code.language-mermaid').forEach(el => {
55
const div = document.createElement('div');
66
div.className = 'mermaid';
77
div.textContent = el.textContent;
88
el.parentElement.replaceWith(div);
99
});
10+
await mermaid.run();
1011
</script>
1112
<style>
1213
.mermaid { text-align: center; }

0 commit comments

Comments
 (0)