Skip to content

Commit d147c25

Browse files
authored
fix: skip labels not included in the allow-list (#113)
Signed-off-by: Michele Dolfi <[email protected]>
1 parent 268c294 commit d147c25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docling_core/types/doc/document.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,9 @@ def export_to_markdown( # noqa: C901
20382038
if ix < from_element or to_element <= ix:
20392039
continue # skip as many items as you want
20402040

2041+
if (isinstance(item, DocItem)) and (item.label not in labels):
2042+
continue # skip any label that is not whitelisted
2043+
20412044
# Handle newlines between different types of content
20422045
if (
20432046
len(mdtexts) > 0

0 commit comments

Comments
 (0)