Skip to content

Commit 7e45817

Browse files
authored
fix: backward compatible add_text() (#132)
Signed-off-by: Michele Dolfi <[email protected]>
1 parent 3e4bf7b commit 7e45817

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
@@ -1515,6 +1515,9 @@ def add_text(
15151515
elif label in [DocItemLabel.SECTION_HEADER]:
15161516
return self.add_heading(text=text, orig=orig, prov=prov, parent=parent)
15171517

1518+
elif label in [DocItemLabel.CODE]:
1519+
return self.add_code(text=text, orig=orig, prov=prov, parent=parent)
1520+
15181521
else:
15191522

15201523
if not parent:

0 commit comments

Comments
 (0)