This commit is contained in:
Ben Schreiber 2026-02-08 21:59:23 -08:00
parent c99b81f61f
commit 07cda662de

View file

@ -23,7 +23,7 @@ class MDBookSidebarScrollbox extends HTMLElement {
link.href = path_to_root + href; link.href = path_to_root + href;
} }
// The 'index' page is supposed to alias the first chapter in the book. // The 'index' page is supposed to alias the first chapter in the book.
// We check both with and without the '.html' suffix to be robust against pretty URLs // Check both with and without the '.html' suffix to be robust against pretty URLs
if (link.href.replace(/\.html$/, '') === current_page.replace(/\.html$/, '') if (link.href.replace(/\.html$/, '') === current_page.replace(/\.html$/, '')
|| i === 0 || i === 0
&& path_to_root === '' && path_to_root === ''