UNPKG

@xiee/utils

Version:

Miscellaneous tools and utilities to manipulate HTML pages

2 lines 623 B
(e=>{!function n(t){t.childNodes.forEach((t=>{t.nodeType===Node.COMMENT_NODE?function(n){const t=n.textContent,a=/^#[\s\n]+([\s\S]+)[\s\n]+$/;if(!a.test(t))return;e.body.classList.add("has-notes","hide-notes");const o=e.createElement("P"===n.parentNode.nodeName?"span":"p");o.className="hash-note",o.innerText=t.replace(a,"$1"),o.innerHTML=o.innerHTML.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>').replace(/(^|[^"])(https?:\/\/)([-a-zA-Z0-9%._=/\+]+)(#)?([-a-zA-Z0-9%._=\+]+)?/g,'$1<a href="$2$3$4$5">$3$4</a>'),n.before(o),n.remove()}(t):n(t)}))}(e.body)})(document); //# sourceMappingURL=hash-notes.min.js.map