PageSourceSearch

https://summer10920.github.io/js/third-party/tags/mermaid.js

js summer10920.github.io collected 2026-10-03 10:00:25 UTC 1,224 bytes, 32 lines download raw bytes

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.