Skip to content

Commit

Permalink
fix: skip labels not included in the allow-list (#113)
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <[email protected]>
  • Loading branch information
dolfim-ibm authored Dec 17, 2024
1 parent 268c294 commit d147c25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,9 @@ def export_to_markdown( # noqa: C901
if ix < from_element or to_element <= ix:
continue # skip as many items as you want

if (isinstance(item, DocItem)) and (item.label not in labels):
continue # skip any label that is not whitelisted

# Handle newlines between different types of content
if (
len(mdtexts) > 0
Expand Down

0 comments on commit d147c25

Please sign in to comment.