Merge pull request #2517 from notriddle/master

Ignore fragment when figuring out sidebar items
This commit is contained in:
Eric Huss 2025-01-02 20:25:15 +00:00 committed by GitHub
commit 0bf6751eed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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";
}