Repository navigation
fix(docx): strip baked-in numbering prefix from ordered list items - #217
Open
Aschenbath wants to merge 2 commits into
Open
Aschenbath wants to merge 2 commits into
Aschenbath wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Author
|
Both P2 review comments were valid and are fixed in c53935e. Stripping now stops unless the first block is a paragraph, and walks text recursively through hyperlinks and across adjacent runs, preserving styles and anchors and checking the separator across spans. Verification:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Programmatic DOCX writers often emit both numPr and the rendered prefix in the text, so an item arrived as "1. first item" while the renderer adds its own "1. " in front. Ordered list items now drop a leading prefix that matches their own marker (composite label when present, otherwise the marker kind's text for the number); bullets and non-matching leading numbers are untouched.
Tests
Closes #81
Summary by cubic
Fixes duplicate numbering on DOCX ordered list items that carry both
numPrand a baked-in prefix, so "1. first item" renders as "1. first item" instead of "1. 1. first item".Written for commit c53935e. Summary will update on new commits.