Skip to content

Commit ad32732

Browse files
committed
Bug fix: no next_sibling on empty id span
1 parent 2ff1a6e commit ad32732

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

jupyter_book_to_htmlbook/text_processing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def move_span_ids_to_sections(chapter):
5151
for span in empty_id_spans:
5252
if (
5353
span.parent.name == "section" and
54+
span.next_sibling and # guard in case of no next_sibling
5455
span.next_sibling.name in ["h1", "h2", "h3", "h4", "h5"]
5556
):
5657
# add span id to section

0 commit comments

Comments
 (0)