File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -4400,12 +4400,15 @@ def extract_items_range(
44004400 "Start NodeItem must come before or be the same as the end NodeItem in the document structure."
44014401 )
44024402
4403- new_doc = DoclingDocument (name = f"{ self .name } - Extracted Range" )
4404-
44054403 ref_items = start_parent .children [start_index :end_index ]
44064404 node_items = [ref .resolve (self ) for ref in ref_items ]
44074405
4408- new_doc .add_node_items (node_items = node_items , doc = self )
4406+ doc_index = DoclingDocument ._DocIndex ()
4407+ for node_item in node_items :
4408+ doc_index .index (doc = self , root = node_item )
4409+
4410+ new_doc = DoclingDocument (name = "" )
4411+ new_doc ._update_from_index (doc_index )
44094412
44104413 if delete :
44114414 self .delete_items_range (
You can’t perform that action at this time.
0 commit comments