Ignore fragment when figuring out sidebar items

This commit is contained in:
Michael Howell 2025-01-02 10:34:03 -07:00
parent 59e6afcaad
commit f92eac4acd

View file

@ -10,7 +10,7 @@ class MDBookSidebarScrollbox extends HTMLElement {
connectedCallback() {
this.innerHTML = '{{#toc}}{{/toc}}';
// Set the current, active page, and reveal it if it's hidden
let current_page = document.location.href.toString();
let current_page = document.location.href.toString().split("#")[0];
if (current_page.endsWith("/")) {
current_page += "index.html";
}