Update docling/backend/msword_backend.py

Co-authored-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com>
Signed-off-by: Maxim Lysak <101627549+maxmnemonic@users.noreply.github.com>
This commit is contained in:
Maxim Lysak 2025-01-31 10:20:24 +01:00 committed by GitHub
parent 53f6d95877
commit 440685c65f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -264,7 +264,7 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend):
and p_style_id not in ["Title", "Heading"] and p_style_id not in ["Title", "Heading"]
): # Close list ): # Close list
if self.level_at_new_list: if self.level_at_new_list:
for key, val in self.parents.items(): for key in range(len(self.parents)):
if key >= self.level_at_new_list: if key >= self.level_at_new_list:
self.parents[key] = None self.parents[key] = None
self.level = self.level_at_new_list - 1 self.level = self.level_at_new_list - 1