forked from LiveCarta/BookConverter
Fix error with Navigable String doesn't have name
This commit is contained in:
@@ -132,7 +132,8 @@ def _remove_headings_content(content_tag, title_of_chapter: str):
|
||||
text = re.sub(r"[\s\xa0]", " ", text).lower()
|
||||
text = text.strip() # delete extra spaces
|
||||
if title_of_chapter == text or \
|
||||
(title_of_chapter in text and re.findall(r"^h[1-3]$", tag.name)):
|
||||
(title_of_chapter in text and
|
||||
re.findall(r"^h[1-3]$", tag.name or content_tag.name)):
|
||||
_add_span_to_save_ids_for_links(tag, content_tag)
|
||||
tag.extract()
|
||||
elif not isinstance(tag, NavigableString):
|
||||
|
||||
Reference in New Issue
Block a user