From 2070eaa3ecd8350a56fe3d174e33ae75da65226d Mon Sep 17 00:00:00 2001 From: Kiryl Date: Thu, 23 Dec 2021 18:31:53 +0300 Subject: [PATCH] Make task to add numbering in titles (I, (ABC)) --- src/docx_converter/html_docx_preprocessor.py | 2 +- src/epub_converter/html_epub_preprocessor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docx_converter/html_docx_preprocessor.py b/src/docx_converter/html_docx_preprocessor.py index e5d4d4b..28f434e 100644 --- a/src/docx_converter/html_docx_preprocessor.py +++ b/src/docx_converter/html_docx_preprocessor.py @@ -434,7 +434,7 @@ class HTMLDocxPreprocessor: title = re.sub(r'^(\s+)+', '', title) title = re.sub(r'^(?:\.?\d+\.? ?)+', '', title) # title = re.sub(r'^(?:\.?[MDCLXVIclxvi]+\.? ?)+ ', '', title) # delete chapter numbering from the title - title = re.sub(r'^(?:[A-Za-z]\. ?)+', '', title) # delete chapter I, (ABC) from the title + # title = re.sub(r'^(?:[A-Za-z]\. ?)+', '', title) # delete chapter I, (ABC) from the title return title @staticmethod diff --git a/src/epub_converter/html_epub_preprocessor.py b/src/epub_converter/html_epub_preprocessor.py index 8743306..16345b6 100644 --- a/src/epub_converter/html_epub_preprocessor.py +++ b/src/epub_converter/html_epub_preprocessor.py @@ -169,7 +169,7 @@ def clean_title_from_numbering(title: str): title = re.sub(r'^(\s+)+', '', title) title = re.sub(r'^(?:\.?\d+\.? ?)+', '', title) # title = re.sub(r'^(?:\.?[MDCLXVIclxvi]+\.? ?)+ ', '', title) # delete chapter numbering from the title - title = re.sub(r'^(?:[A-Za-z]\. ?)+', '', title) # delete chapter I, (ABC) from the title + # title = re.sub(r'^(?:[A-Za-z]\. ?)+', '', title) # delete chapter I, (ABC) from the title return title