pretty url fix
This commit is contained in:
parent
b8c90970a6
commit
c99b81f61f
1 changed files with 2 additions and 1 deletions
|
|
@ -23,7 +23,8 @@ class MDBookSidebarScrollbox extends HTMLElement {
|
|||
link.href = path_to_root + href;
|
||||
}
|
||||
// The 'index' page is supposed to alias the first chapter in the book.
|
||||
if (link.href === current_page
|
||||
// We check both with and without the '.html' suffix to be robust against pretty URLs
|
||||
if (link.href.replace(/\.html$/, '') === current_page.replace(/\.html$/, '')
|
||||
|| i === 0
|
||||
&& path_to_root === ''
|
||||
&& current_page.endsWith('/index.html')) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue