Repository navigation
fix: keep labels of auto-numbered DOCX lists - #4508
Conversation
Word computes list labels from numbering.xml at render time, so partition_docx returned ListItem text without them. Resolve numbering from the paragraph or its style chain and prefix the rendered label. Bullets stay unprefixed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…DOCX list labels Advance list counters for bullets, empty paragraphs and table paragraphs, and honor lvlRestart. Shift hyperlink offsets past the generated label. Ignore levels and start values outside Word's range, render ordinal and circled formats, and leave the text unlabeled for number formats that cannot be rendered. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…r paragraph Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 2 unresolved issues from previous reviews.
Re-trigger cubic
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 2 unresolved issues from previous reviews.
Re-trigger cubic
Review of Unstructured-IO/unstructured PR #4508Findings[P1 · High] Keep counters per
|
…n restart Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Shadow auto-approve: would not auto-approve. This PR does not meet the repository auto-approval settings.
Re-trigger cubic
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@aadland6 thanks for the review. I checked each point in Word for Mac with minimal DOCX files:
|
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Shadow auto-approve: would not auto-approve. This PR does not meet the repository auto-approval settings.
Re-trigger cubic
… section-break paragraphs (Unstructured-IO#4538) ## What Follow-up to Unstructured-IO#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 `ListItem`s. - 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](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
What
Word does not store the label of an auto-numbered list item (
1.,a),iv.) in the paragraph. It computes the label at render time fromnumbering.xml, sopartition_docx()returnedListItemtext with no label, while typed-in numbers were kept.The label is now resolved and prefixed to the item text:
numId/ilvlcome from the paragraph'sw:numPror its style chain (includingbasedOn), mapped throughabstractNumwithlvlOverride/startOverride.numFmt(decimal, letters, roman numerals, ...) andlvlText(%1.,%2),(%3), ...).This changes
ListItem.textfor every auto-numbered DOCX, so one existing expectation was updated to include the label.🤖 Generated with Claude Code