fix: label numbered headings without making them list items, and skip section-break paragraphs

Merged
QU
13d ago
+767-33

What

Follow-up to #4508, bringing partition_docx() closer to what Word renders for auto-numbered paragraphs:

  • A numbered paragraph of any element type now carries its label in the text, not only list items. Numbered headings come out as, for example, Title "4.2. Overview". Bullets stay unprefixed.
  • A numbered heading is no longer classified as a ListItem, whether its number comes from its style or from the paragraph's own numbering. A heading is a paragraph in a title-mapped style (Heading 1, Title, and so on) or whose style chain or own properties give it an outline level of 0 to 8. It still advances the list counter, as it does in Word. Paragraphs in other styles that carry their own numbering, such as List Paragraph or Caption, stay ListItems.
  • An empty paragraph that only holds a section break no longer consumes a list number. Word does not number it, so every later item in the list was shifted by one (for example 11.3.2. came out as 11.3.3.).

šŸ¤– Generated with Claude Code