<script>
(function () {
    var codes = document.querySelectorAll("#content pre code:not(.language-mermaid)");
    if (!codes.length) return;

    function apply() {
        if (!window.hljs) return;
        codes.forEach(function (c) {
            c.classList.add("hljs");
            hljs.highlightElement(c);
            if (window.hljs.lineNumbersBlock) {
                hljs.lineNumbersBlock(c);
            }
        });
    }

    function loadPlugin() {
        if (window.hljs && window.hljs.lineNumbersBlock) { apply(); return; }
        var s = document.createElement("script");
        s.src = "api/notes/__HLJS_LN_ID__/download";
        s.onload = apply;
        document.head.appendChild(s);
    }

    if (window.hljs) { loadPlugin(); return; }

    var s = document.createElement("script");
    s.src = "api/notes/__HLJS_ID__/download";
    s.onload = loadPlugin;
    document.head.appendChild(s);
})();
</script>