Skip to content

Commit

Permalink
remove strip()
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <[email protected]>
  • Loading branch information
dolfim-ibm committed Jan 31, 2025
1 parent 0138395 commit 9dbbfa8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -2426,7 +2426,7 @@ def _prepare_tag_content(
]:

text = "<ol>"
html_texts.append(text.strip())
html_texts.append(text)

# Increment list nesting level when entering a new list
in_ordered_list.append(True)
Expand All @@ -2436,7 +2436,7 @@ def _prepare_tag_content(
]:

text = "<ul>"
html_texts.append(text.strip())
html_texts.append(text)

# Increment list nesting level when entering a new list
in_ordered_list.append(False)
Expand All @@ -2447,7 +2447,7 @@ def _prepare_tag_content(
elif isinstance(item, TextItem) and item.label in [DocItemLabel.TITLE]:

text = f"<h1>{_prepare_tag_content(item.text)}</h1>"
html_texts.append(text.strip())
html_texts.append(text)

elif isinstance(item, SectionHeaderItem):

Expand All @@ -2457,7 +2457,7 @@ def _prepare_tag_content(
f"<h{(section_level)}>"
f"{_prepare_tag_content(item.text)}</h{(section_level)}>"
)
html_texts.append(text.strip())
html_texts.append(text)

elif isinstance(item, TextItem) and item.label in [DocItemLabel.FORMULA]:

Expand Down Expand Up @@ -2495,12 +2495,12 @@ def _prepare_tag_content(
item.text, do_escape_html=False, do_replace_newline=False
)
text = f"<pre><code>{code_text}</code></pre>"
html_texts.append(text.strip())
html_texts.append(text)

elif isinstance(item, TextItem):

text = f"<p>{_prepare_tag_content(item.text)}</p>"
html_texts.append(text.strip())
html_texts.append(text)
elif isinstance(item, TableItem):

text = item.export_to_html(doc=self, add_caption=True)
Expand Down

0 comments on commit 9dbbfa8

Please sign in to comment.