script. if (document.getElementsByClassName('mermaid').length) { if (window.mermaidJsLoad) mermaid.init() else { $.getScript('!{theme.CDN.mermaid}', function () { window.mermaidJsLoad = true mermaid.initialize({ theme: '!{theme.mermaid.theme}', }) !{theme.pjax} && mermaid.init() }) } }