(function(){ var done={}; function fix(){ if(!window.mermaid)return; document.querySelectorAll('pre code').forEach(function(el){ var t=el.textContent.trim(); if(done[t])return; if(/^(graph\s+(TD|TB|LR|RL|BT)|flowchart|sequenceDiagram|classDiagram|stateDiagram|gantt|pie|erDiagram|journey)/i.test(t)){ done[t]=1; var c=t; try{c=c.normalize("NFD").replace(/[\u0300-\u036f]/g,"");}catch(e){} c=c.replace(/'/g," "); var wrap=document.createElement("div"); wrap.className="mermaid-container"; var pre=document.createElement("pre"); pre.className="mermaid"; pre.textContent=c; var parent=el.closest("pre")||el.parentElement; parent.parentElement.insertBefore(wrap,parent); wrap.appendChild(pre); parent.style.display="none"; mermaid.run({nodes:[pre]}).then(function(){ pre.setAttribute("data-processed","true"); parent.remove(); }).catch(function(){ wrap.remove(); parent.style.display=""; }); } }); } var iv=setInterval(fix,2000); setTimeout(function(){clearInterval(iv);},30000); new MutationObserver(function(){setTimeout(fix,500);}).observe(document.body,{childList:true,subtree:true}); })();