Update livecarta_config.py with processing changes

This commit is contained in:
Kiryl
2022-06-27 19:16:17 +03:00
parent 9b4ecfd63c
commit eab4f0130a
2 changed files with 11 additions and 4 deletions

View File

@@ -198,7 +198,7 @@ def _remove_headings_content(content_tag, title_of_chapter: str):
text = tag if isinstance(tag, NavigableString) else tag.text
if re.sub(r"[\s\xa0]", "", text):
text = re.sub(r"[\s\xa0]", " ", text).lower()
text = text.strip() # delete extra spaces
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 or content_tag.name)):