Clean of "< >"

This commit is contained in:
Kibzik
2023-03-16 12:09:36 +03:00
parent dd49bfd76c
commit e473e45685

View File

@@ -28,6 +28,9 @@ class HtmlEpubProcessor:
"""
# clean extra whitespace characters ([\r\n\t\f\v ])
title = re.sub(r"[\s\xa0]", " ", title_of_chapter).strip()
to_replace = {"<": "&gt;", ">": "&lt;"}
for char in to_replace.keys():
title = title.replace(char, to_replace[char])
return title
@staticmethod