fix: resolve OOXML lvlText templates in numbered list markers#271
Open
sted wants to merge 1 commit intoeigenpal:mainfrom
Open
fix: resolve OOXML lvlText templates in numbered list markers#271sted wants to merge 1 commit intoeigenpal:mainfrom
sted wants to merge 1 commit intoeigenpal:mainfrom
Conversation
Numbered list markers were rendering as the raw lvlText template (e.g. "%1." or "%1.%2.") instead of resolved values like "1.", "A.", "II.1.". The parser stored level.lvlText verbatim on listRendering.marker, and toFlowBlocks only ran counter resolution when listMarker was unset, so any DOCX with parsed numbering definitions leaked %N tokens through to the painter — including inside table cells and text boxes, where a second code path bypassed marker resolution entirely. Changes: - paragraphParser collects per-level numFmts (0..ilvl) so multi-level templates like "%1.%2." can format each %N with its own format (e.g. upperRoman parent + decimal child) - ParagraphAttrs.listLevelNumFmts plumbs this through ProseMirror - toFlowBlocks centralises marker resolution in convertParagraphAttrs via a shared listCounters map, covering body, table, and text-box paragraphs in one place - resolveListTemplate handles decimal, upperLetter, lowerLetter, upperRoman, lowerRoman, decimalZero, none (ECMA-376 §17.9.11) - Unit tests cover each numFmt, multi-level templates, mixed formats, and the parser's per-level numFmt collection
|
@sted is attempting to deploy a commit to the EigenPal Team on Vercel. A member of the Team first needs to authorize it. |
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
Numbered list markers were rendering as the raw lvlText template (e.g.
"%1." or "%1.%2.") instead of resolved values like "1.", "A.", "II.1.".
The parser stored level.lvlText verbatim on listRendering.marker, and
toFlowBlocks only ran counter resolution when listMarker was unset, so
any DOCX with parsed numbering definitions leaked %N tokens through to
the painter — including inside table cells and text boxes, where a
second code path bypassed marker resolution entirely.
Changes:
templates like "%1.%2." can format each %N with its own format
(e.g. upperRoman parent + decimal child)
via a shared listCounters map, covering body, table, and text-box
paragraphs in one place
upperRoman, lowerRoman, decimalZero, none (ECMA-376 §17.9.11)
and the parser's per-level numFmt collection
Test plan
bun run typecheckpassesbun testpassesbun run buildsucceeds