epub converter: add internal links processing2

This commit is contained in:
shirshasa
2021-05-26 08:15:56 +03:00
parent 3eac136e07
commit 836e2dbc11
3 changed files with 35 additions and 12 deletions

View File

@@ -241,6 +241,8 @@ def unwrap_structural_tags(body_tag):
# should be before other tags processing, not to remove converter empty tags with id
# not all cases, if span has <p>s and NavigableString, it won't unwrap
for s in body_tag.find_all("span"):
if s.attrs.get('epub:type') == 'pagebreak':
continue
if s.contents:
is_not_struct_tag = [child.name not in structural_tags_names for child in s.contents]
if all(is_not_struct_tag):