PageSourceSearch

https://eclo.re/automad/dist/build/blocks/TableOfContents-1d66e53f.js

js eclo.re collected 2026-10-05 03:39:35 UTC 782 bytes, 2 lines download raw bytes

1/* Automad, (c) Marc Anton Dahmen, MIT license */
2var p=(i,e=document)=>Array.from(e.querySelectorAll(i));var l=class{element;get listTag(){return this.element.getAttribute("type")=="ordered"?"ol":"ul"}constructor(e){if(this.element=e,document.readyState==="loading"){document.addEventListener("DOMContentLoaded",this.render.bind(this));return}this.render()}render(){let e=0,t=1,r="";p("h2[id], h3[id], h4[id]").forEach(a=>{let s=parseInt(a.tagName.replace(/h/i,""));if(s>t){let n=s-t;for(let o=1;o<=n;o++)e++,r+=`<${this.listTag}><li>`}if(s<t){let n=t-s;for(let o=1;o<=n;o++)e--,r+=`</li></${this.listTag}>`}s<=t&&(r+="</li><li>"),r+=`<a href="#${a.id}">${a.textContent}</a>`,t=s});for(var d=1;d<=e;d++)r+=`</li></${this.listTag}>`;this.element.innerHTML=r}};export{l as default};

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.