Skip to content

Commit

Permalink
print-toc: Remove word joiners and nbsp from generated ToC
Browse files Browse the repository at this point in the history
  • Loading branch information
acabal committed Aug 7, 2020
1 parent 5186efc commit 5ba244f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion se/se_epub.py
Expand Up @@ -918,7 +918,13 @@ def generate_toc(self) -> str:

from se.se_epub_generate_toc import generate_toc # pylint: disable=import-outside-toplevel

return generate_toc(self)
toc_xhtml = generate_toc(self)

# Word joiners and nbsp don't go in the ToC
toc_xhtml = toc_xhtml.replace(se.WORD_JOINER, "")
toc_xhtml = toc_xhtml.replace(se.NO_BREAK_SPACE, " ")

return toc_xhtml

def generate_endnotes(self) -> Tuple[int, int]:
"""
Expand Down

0 comments on commit 5ba244f

Please sign in to comment.