1/* global NexT, CONFIG, mermaid */ 2 3document.addEventListener('page:loaded', () => { 4 const mermaidElements = document.querySelectorAll('pre > .mermaid'); 5 if (mermaidElements.length) { 6 NexT.utils.getScript(CONFIG.mermaid.js, { 7 condition: window.mermaid 8 }).then(() => { 9 mermaidElements.forEach(element => { 10 const box = document.createElement('div'); 11 box.className = 'code-container'; 12 const newElement = document.createElement('div'); 13 newElement.innerHTML = element.innerHTML; 14 newElement.className = 'mermaid'; 15 box.appendChild(newElement); 16 if (CONFIG.codeblock.copy_button.enable) { 17 NexT.utils.registerCopyButton(box, box, element.textContent); 18 } 19 const parent = element.parentNode; 20 parent.parentNode.replaceChild(box, parent); 21 }); 22 mermaid.initialize({ 23 theme : CONFIG.darkmode && window.matchMedia('(prefers-color-scheme: dark)').matches ? CONFIG.mermaid.theme.dark : CONFIG.mermaid.theme.light, 24 logLevel : 4, 25 flowchart: { curve: 'linear' }, 26 gantt : { axisFormat: '%m/%d/%Y' }, 27 sequence : { actorMargin: 50 } 28 }); 29 mermaid.run(); 30 }); 31 } 32});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.