fix(index.html): match only on end of path

Otherwise, document.querySelector will return a null value when trying
to patch on an entire path.
pull/1/head
Luke Hsiao 4 years ago
parent 929edf6c02
commit 2239379ddc

@ -114,7 +114,7 @@
document.querySelectorAll(".toc a").forEach((item) => {
item.classList.remove("active");
});
document.querySelector(".toc a[href='" + pathname + "#" + heading + "']").classList.add("active");
document.querySelector(".toc a[href$='" + pathname + "#" + heading + "']").classList.add("active");
}
let currentHeading = "";
@ -143,4 +143,4 @@
}
</script>
</html>
</html>

Loading…
Cancel
Save