Skip to content

Commit

Permalink
add test, minor cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Panos Vagenas <[email protected]>
  • Loading branch information
vagenas committed Jul 18, 2024
1 parent fc0d076 commit 8c3afc6
Show file tree
Hide file tree
Showing 4 changed files with 6,254 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""Models for the Docling Document data type."""

from datetime import datetime
from typing import Generic, List, Optional, Union
from typing import Generic, Optional, Union

from pydantic import (
AnyHttpUrl,
Expand Down Expand Up @@ -413,7 +413,7 @@ def export_to_markdown(
"""Return a Markdown serialization of the document."""
has_title = False
prev_text = ""
md_texts: List[str] = []
md_texts: list[str] = []

if self.main_text is not None:
for orig_item in self.main_text[start_incl:end_excl]:
Expand All @@ -436,8 +436,6 @@ def export_to_markdown(
}:
text = item.text

print(f"{text=}, {has_title=}, {item_type=}")

# ignore repeated text
if prev_text == text:
continue
Expand Down
Loading

0 comments on commit 8c3afc6

Please sign in to comment.