Skip to content

Conversation

@wantbook-book
Copy link

@wantbook-book wantbook-book commented Dec 24, 2025

Issue resolved by this Pull Request:

Resolves #2758

Description:

  • Walk the paragraph style inheritance chain to resolve w:numPr when it is not directly on the paragraph.
  • Parse numbering.xml to render multi-level markers based on lvlText/start/numFmt, instead of flattening to single-level counters.
  • Add regression tests covering paragraph-level numbering and style-inherited numbering.
  • Note: this changes list/heading markers to follow lvlText (e.g., %1.), so existing groundtruth like list_after_num_headers.docx may need updates.

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Tests:

  • pytest test_docx_numbering.py -q

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

DCO Check Passed

Thanks @wantbook-book, all your commits are properly signed off. 🎉

@dosubot
Copy link

dosubot bot commented Dec 24, 2025

Related Documentation

Checked 9 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@mergify
Copy link

mergify bot commented Dec 24, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 Require two reviewer for test updates

This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

I, akai <2780896955@qq.com>, hereby add my Signed-off-by to this commit: 7adf1ad
I, akai <2780896955@qq.com>, hereby add my Signed-off-by to this commit: 74fb841
I, akai <2780896955@qq.com>, hereby add my Signed-off-by to this commit: a3a58bf
I, akai <2780896955@qq.com>, hereby add my Signed-off-by to this commit: 3e564bf
I, akai <2780896955@qq.com>, hereby add my Signed-off-by to this commit: 7deeb85

Signed-off-by: akai <2780896955@qq.com>
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 5.90909% with 207 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
docling/backend/msword_backend.py 5.90% 207 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ceberam
Copy link
Member

ceberam commented Jan 5, 2026

Thanks @wantbook-book for suggesting this fix.
Could you please check the regression tests that are failing (basically, the test file tests/test_backend_msword.py)? It may be that the ground truth files need to be updated to reflect the new, correct conversion.

@ceberam ceberam added bug Something isn't working docx issue related to docx backend labels Jan 5, 2026
@ceberam ceberam self-assigned this Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working docx issue related to docx backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-level outline numbering incorrectly rendered as single-level in DOCX

2 participants