Fix error in ToC script at the bottom of the page (#2002)

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-11-19 23:06:20 +01:00 committed by GitHub
parent 0ce83512fc
commit 0657cc1848
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -107,6 +107,11 @@ function getCurrentHeading(headings, headerOffset) {
index += 1;
}
// At the bottom of the page we might not have a heading.
if (!currentHeading) {
currentHeading = prevHeading;
}
return currentHeading;
}

View file

@ -0,0 +1 @@
Improve the JS script to highlight the current ToC entry.