Repository navigation
fix(docx): resolve linked style numbering - #4727
PeterStaar-IBM merged 4 commits into
Conversation
|
✅ DCO Check Passed Thanks @LubabaKhalid, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The PR makes the DOCX backend follow `w:numStyleLink` when it looks up numbering levels. It also syncs heading counters with list counters, and it writes custom-numbered captions as paragraph text instead of list items. CI safety: no concern found. A maintainer must still approve CI. The |
Signed-off-by: Lubaba Khalid <129605617+LubabaKhalid@users.noreply.github.com>
There was a problem hiding this comment.
AI first review (advisory): changes are suggested
This review covers the full diff at a4604e656e. It read the code only. It did not run tests or code from this pull request.
This pull request resolves DOCX heading numbering definitions that reference linked list styles through w:numStyleLink, synchronizes heading counters with list templates, and renders numbered captions as paragraph text. The main risks are cross-chapter caption counter accumulation due to missing subordinate counter resets and accidental inclusion of unrelated layout postprocessor changes from PR #4704.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
a4604e6 to
bde71bd
Compare
|
I checked the head (bde71bd) against the two documents of #4599:
No other line of the Markdown export changes. One limit: all 7 tables are in chapter 14, so these documents do not test the table counter in a new chapter. |
Thanks for testing both documents and confirming the heading numbering and unchanged Markdown output! Good point about the table counter across chapters. I'll look into adding coverage for that case. |
Signed-off-by: Lubaba Khalid <129605617+LubabaKhalid@users.noreply.github.com>
3cdd324 to
2391415
Compare
…s.noreply.github.com> I, Lubaba Khalid <129605617+LubabaKhalid@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 70ca33f Signed-off-by: Lubaba Khalid <129605617+LubabaKhalid@users.noreply.github.com>
Thanks for pointing out the cross-chapter counter gap! I've added regression coverage to verify that caption numbering restarts at |
|
The new head (6c125d7) gives the same result on both documents. |
|
@PeterStaar-IBM Could you please review this PR? |
Summary
Fix DOCX heading numbering when numbering definitions use
w:numStyleLinkto reference a linked list style.w:numStyleLinkto resolve numbering levels from the linked paragraph style.Tabell %1.%7use the correct chapter number.Issue resolved by this Pull Request:
Resolves #4599
Checklist
Review evidence
Before: Headings numbered through a linked list style lost their numbers. Custom-numbered table captions could also lose their numbering and be exported as Markdown list items.
After: The reported Prop. 39 L document produces the expected headings:
2 Gjeldende rett2.1 Nemndas klagesaksbehandling2.2 Søksmål om nemndas vedtakThe reported Prop. 34 L document produces the expected
Tabell 14.1 Saker som kan rettsmekles...caption without an unwanted Markdown list bullet.Checks performed:
ruff checkon the modified backend and test files — passed.pytest -q tests/test_backend_msword.py tests/test_backend_msword_lists.py— 269 passed, 1 skipped.git diff --check— passed.The regression tests cover linked numbering-style resolution, heading/list-counter synchronization, and custom caption numbering.