forked from LiveCarta/BookConverter
Make task to add numbering in titles (I, (ABC))
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user