Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed docx import with headers that are also lists #842

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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>
maxmnemonic and ceberam authored Jan 31, 2025
commit 440685c65fe85e96b1256251a448b8676e1adede
2 changes: 1 addition & 1 deletion docling/backend/msword_backend.py
Original file line number Diff line number Diff line change
@@ -264,7 +264,7 @@ def handle_text_elements(self, element, docx_obj, doc):
and p_style_id not in ["Title", "Heading"]
): # Close 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:
self.parents[key] = None
self.level = self.level_at_new_list - 1