epub converter: fix <pre> 3

This commit is contained in:
shirshasa
2021-07-06 16:03:40 +03:00
parent 6cc4b30405
commit a6f70f6731

View File

@@ -406,6 +406,7 @@ def preprocess_pre_tags(chapter_tag):
if isinstance(child, NavigableString):
text = escape(pre.text)
text = text.replace('\t', '&nbsp; &nbsp; &nbsp; ')
text = text.replace(' ', '&nbsp; ')
elements = re.split('\r\n|\n|\r', text)
for i in elements:
new_tag.append(NavigableString(i))