import{create,all}from"./lib";/* enhancements to native html elements */constloadHeadings=()=>{/* Allow users to copy links from headings */constheadings="h1, h2, h3, h4, h5, h6";all(headings).forEach((heading)=>{constheadingId=heading.id;constbtn=create("button",{className: "inlineText",innerText: "#",onclick: (e)=>{console.log(e.target);consturl=window.location.origin+window.location.pathname;constlink=`${url}#${headingId}`;navigator.clipboard.writeText(link);},});heading.prepend(btn);});};/* Support footnotes */constsupportFootnotes=()=>{constfootnoteReferences="sup";constfootnotes='li[id^="fn-"]';all(footnoteReferences).forEach((footnoteRef)=>{footnoteRef.classList.add("footnoteRef");constfootnoteId=footnoteRef.id;constrefNum=footnoteId.replace("fnref-","");(footnoteRef.children[0]asHTMLPreElement).innerText=`[${refNum}]`;});all(footnotes).forEach((footnote)=>{footnote.classList.add("footnote");});};document.addEventListener("DOMContentLoaded",(event)=>{loadHeadings();supportFootnotes();});