Docx reader: key list numbering off abstractNumId.

Word represents "restart numbering" on a style-based list by pointing
only the first item of the restarted list at a new `numId` that shares the
original list's abstract numbering definition but carries a
`w:startOverride`; the remaining items keep using the original `numId`.

Pandoc keyed list continuation and grouping on the `numId`, so the
restarted items continued the stale count from the earlier list (and
were split into a separate ordered list with the wrong start).

Key continuation and grouping off the `abstractNumId` instead (the real
running counter in Word), and treat `startOverride` as a restart that
resets the count.

Closes #8367.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
John MacFarlane
2026-06-09 09:58:26 +00:00
parent c60b7f3f08
commit 1b4a5356b4
5 changed files with 59 additions and 13 deletions
+4
View File
@@ -281,6 +281,10 @@ tests = [ testGroup "document"
"sublists reset numbering to 1"
"docx/lists_sublist_reset.docx"
"docx/lists_sublist_reset.native"
, testCompare
"style-based list restarted on one item (#8367)"
"docx/lists_restart_8367.docx"
"docx/lists_restart_8367.native"
, testCompare
"definition lists"
"docx/definition_list.docx"
Binary file not shown.
+13
View File
@@ -0,0 +1,13 @@
[Header 1 ("section-1",[],[]) [Str "Section",Space,Str "1"]
,OrderedList (1,Decimal,Period)
[[Para [Str "Item",Space,Str "1"]]
,[Para [Str "Item",Space,Str "2"]]
,[Para [Str "Item",Space,Str "3"]]]
,Para [Str "Conclusion"]
,Header 1 ("section-2",[],[]) [Str "Section",Space,Str "2"]
,OrderedList (1,Decimal,Period)
[[Para [Str "Item",Space,Str "1"]]
,[Para [Str "Item",Space,Str "2"]]
,[Para [Str "Item",Space,Str "3"]]
,[Para [Str "Item",Space,Str "4"]]]
,Para [Str "Conclusion"]]