2 parents c4d1b97 + 81e0bb2 commit 796cd14Copy full SHA for 796cd14
1 file changed
docs/_includes/head-custom.html
@@ -4,10 +4,14 @@
4
document.addEventListener("DOMContentLoaded", async function() {
5
const elements = document.querySelectorAll('.language-mermaid');
6
elements.forEach(el => {
7
- const codeBlock = el.querySelector('code');
8
- if (codeBlock) {
9
- el.textContent = codeBlock.textContent;
10
- el.classList.add('mermaid');
+ if (el.tagName === 'CODE') {
+ const pre = el.parentElement;
+ if (pre && pre.tagName === 'PRE') {
+ const mermaidDiv = document.createElement('div');
11
+ mermaidDiv.className = 'mermaid';
12
+ mermaidDiv.textContent = el.textContent;
13
+ pre.replaceWith(mermaidDiv);
14
+ }
15
}
16
});
17
await mermaid.run({
0 commit comments