diff --git a/src/html_epub_preprocessor.py b/src/html_epub_preprocessor.py index e7a3958..6d04ddc 100644 --- a/src/html_epub_preprocessor.py +++ b/src/html_epub_preprocessor.py @@ -260,7 +260,7 @@ 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

s and NavigableString, it won't unwrap for s in body_tag.find_all("span"): - if s.attrs.get('epub:type') == 'pagebreak': + if (s.attrs.get('epub:type') == 'pagebreak') or s.attrs.get('id'): continue if s.contents: is_not_struct_tag = [child.name not in structural_tags_names for child in s.contents]