Skip to content

Commit

Permalink
Outline remove toggle mark
Browse files Browse the repository at this point in the history
Signed-off-by: Hollow Man <[email protected]>
  • Loading branch information
HollowMan6 committed Dec 27, 2022
1 parent 2e4f709 commit 433b5cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mdbook_pdf_outline/mdbook_pdf_outline.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ def parse_toc(toc, reader, writer, parent_dict, level=1):
dest_name = "/"
a_element = None
for element in head.iter():
if element.tag == "a":
if element.tag == "a" and "href" in element.attrib:
a_element = element
break
to_remove = head.find_class("toggle")
for element in to_remove:
element.getparent().remove(element)
if a_element is None:
continue
for content in a_element.attrib["href"].split("#"):
Expand Down

0 comments on commit 433b5cf

Please sign in to comment.