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:
parent
0ce83512fc
commit
0657cc1848
2 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue