Added remove of current

This commit is contained in:
Kevin Veen-Birkenbach 2025-03-17 16:50:17 +01:00
parent af27d50214
commit be62b72e90
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E

View File

@ -34,6 +34,9 @@
if (href && href.trim().startsWith("#")) {
if (href.trim() === currentHash.trim()) {
console.log("initCurrentNav: Match found for hash-only link:", href);
document.querySelectorAll('.current-index a.reference.internal.current').forEach(function(link) {
link.classList.remove("current");
});
link.classList.add("current");
markAsCurrent(link);
}