FIX: Ignore link click counts (#23)

This commit is contained in:
Penar Musaraj 2022-01-19 11:53:13 -05:00 committed by GitHub
parent aa35509588
commit ff434a4f7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -250,10 +250,16 @@ function buildTOC(nodesList, elm, lv = 1) {
li = elm.appendChild(document.createElement("li"));
li.classList.add("d-toc-item");
li.innerHTML = `<a data-d-toc="${node.getAttribute("id")}">${
node.textContent
let clonedNode = node.cloneNode(true);
clonedNode.querySelector("span.clicks")?.remove();
li.innerHTML = `<a data-d-toc="${clonedNode.getAttribute("id")}">${
clonedNode.textContent
}</a>`;
clonedNode.remove();
// recurse
buildTOC(nodes, elm, lv + cnt);
}