diff --git a/docling_core/types/doc/document.py b/docling_core/types/doc/document.py index e95a9d29..b3e72388 100644 --- a/docling_core/types/doc/document.py +++ b/docling_core/types/doc/document.py @@ -1109,12 +1109,6 @@ def export_to_html( caption_text = get_html_tag_with_text_direction( html_tag="caption", text=text ) - """ - body = ( - f'' - f"{body}
{text}
" - ) - """ body = f"{caption_text}{body}
" elif len(text) == 0 and len(body) > 0: @@ -1123,7 +1117,6 @@ def export_to_html( caption_text = get_html_tag_with_text_direction( html_tag="caption", text=text ) - # body = f'
{text}
' body = f"{caption_text}
" else: body = "
" @@ -2497,8 +2490,6 @@ def _prepare_tag_content( elif isinstance(item, TextItem) and item.label in [DocItemLabel.TITLE]: text_inner = _prepare_tag_content(item.text) - # dir = get_text_direction(item.text) - # text = f'

{text_inner}

' text = get_html_tag_with_text_direction(html_tag="h1", text=text_inner) html_texts.append(text) @@ -2507,14 +2498,6 @@ def _prepare_tag_content( section_level: int = min(item.level + 1, 6) - """ - dir = get_text_direction(item.text) - - text = ( - f'' - f"{_prepare_tag_content(item.text)}" - ) - """ text = get_html_tag_with_text_direction( html_tag=f"h{section_level}", text=item.text ) @@ -2580,16 +2563,12 @@ def _image_fallback(item: TextItem): ) elif isinstance(item, ListItem): - # dir = get_text_direction(item.text) - # text = f'
  • {_prepare_tag_content(item.text)}
  • ' text = get_html_tag_with_text_direction( html_tag="li", text=_prepare_tag_content(item.text) ) html_texts.append(text) elif isinstance(item, TextItem) and item.label in [DocItemLabel.LIST_ITEM]: - # dir = get_text_direction(item.text) - # text = f'
  • {_prepare_tag_content(item.text)}
  • ' text = get_html_tag_with_text_direction( html_tag="li", text=_prepare_tag_content(item.text) ) @@ -2603,8 +2582,6 @@ def _image_fallback(item: TextItem): html_texts.append(text) elif isinstance(item, TextItem): - # dir = get_text_direction(item.text) - # text = f'

    {_prepare_tag_content(item.text)}

    ' text = get_html_tag_with_text_direction( html_tag="p", text=_prepare_tag_content(item.text)