diff --git a/src/html_preprocessor.py b/src/html_preprocessor.py index dd9208a..6b94343 100644 --- a/src/html_preprocessor.py +++ b/src/html_preprocessor.py @@ -148,9 +148,14 @@ class HTMLPreprocessor: # there we remove 1 unnecessary
brs = p.find_all('br') text = p.text + if brs and text == '\n\n' and len(brs) == 2: brs[0].decompose() + indent_should_be_added = False + if text and ((text[0:1] == '\t') or (text[:2] == '\n\t')): + indent_should_be_added = True + align = p.get('align') style = p.get('style') @@ -178,8 +183,8 @@ class HTMLPreprocessor: if align is not None and align != LawCartaConfig.DEFAULT_ALIGN_STYLE: style += f'text-align: {align};' - if indent is not None: - indent = indent.group(1) + if indent is not None or indent_should_be_added: + # indent = indent.group(1) style += f'text-indent: {LawCartaConfig.INDENT};' if style: