mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Verify that parents isn't empty before popping
If the first iteration of the loop isn't a match then parents will be an empty list.
This commit is contained in:
@@ -95,7 +95,8 @@ def _parse_html_table_of_contents(html):
|
||||
if line.endswith('<ul>'):
|
||||
parents.append(nav)
|
||||
elif line.startswith('</ul>'):
|
||||
parents.pop()
|
||||
if parents:
|
||||
parents.pop()
|
||||
|
||||
# For the table of contents, always mark the first element as active
|
||||
if ret:
|
||||
|
||||
Reference in New Issue
Block a user