From 515f1ef8bd584bd96923333c16011eff194ed38b Mon Sep 17 00:00:00 2001 From: shirshasa Date: Fri, 28 May 2021 08:22:29 +0300 Subject: [PATCH] epub converter: add internal links processing 6a --- src/html_epub_preprocessor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/html_epub_preprocessor.py b/src/html_epub_preprocessor.py index d226fe5..744ed08 100644 --- a/src/html_epub_preprocessor.py +++ b/src/html_epub_preprocessor.py @@ -114,6 +114,7 @@ def _process_lists(body_tag): def clean_headings_content(content: Tag, title: str): + title = title.lower() for child in content.contents: if isinstance(child, NavigableString): text = child @@ -122,6 +123,7 @@ def clean_headings_content(content: Tag, title: str): if text and re.sub(r'([\n\t\xa0])', '', text): text = re.sub(r'([\n\t\xa0])', ' ', text) text = re.sub(r' +', ' ', text).strip() + text = text.lower() if title == text: child.extract() elif (title in text) and (child.name in ['h1', 'h2', 'h3']):