Fix Word Desktop nested list spacing - #3469
Open
Bryan Valverde U (BryanValverdeU) wants to merge 2 commits into
Open
Bryan Valverde U (BryanValverdeU) wants to merge 2 commits into
Bryan Valverde U (BryanValverdeU) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919
Bryan Valverde U (BryanValverdeU)
requested review from
Jiuqing Song (JiuqingSong),
Karlee Wong (KarleeWong),
flyingbee2012,
Julia Roldi (juliaroldi) and
Vi Nguyen (vinguyen12)
and
a balanced review from Copilot
October 5, 2026 22:24
Copilot started reviewing on behalf of
Bryan Valverde U (BryanValverdeU)
October 5, 2026 22:36
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The shorthand parser corrupts valid margins containing whitespace inside CSS functions.
Review effort: Balanced
Findings: 1
What changed in this PR
Preserves Word Desktop list spacing while preventing duplicated nested indentation.
Changes:
- Preserve vertical margins while removing horizontal margins.
- Remove redundant nested-list indentation.
- Update unit, integration, and paste tests.
| File | Description |
|---|---|
removeListParagraphMargins.ts |
Preserves vertical margins. |
processWordLists.ts |
Removes nested horizontal indentation. |
removeListParagraphMarginsTest.ts |
Updates margin tests. |
processPastedContentFromWordDesktopTest.ts |
Updates content-model expectations. |
wordNestedListMarginTest.ts |
Adds nested-list regression coverage. |
cmPasteFromWordTest.ts |
Updates end-to-end expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+52
to
+55
| const values = value | ||
| .substring(0, importantMatch?.index ?? value.length) | ||
| .trim() | ||
| .split(/\s+/); |
|
Bryan Valverde U (BryanValverdeU)
force-pushed
the
u/bvalverde/fixNestedListsSpacing
branch
from
October 5, 2026 22:48
5824c5f to
418b77a
Compare
Parse margin shorthand by top-level whitespace so CSS function values such as calc() and var() are preserved when removing horizontal Word list margins. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919
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
Fixes Word Desktop nested list spacing by preserving Word's vertical list paragraph margins while removing duplicated horizontal indentation from nested list levels and nested list item formats.
Before this change, pasted nested bullets could gain extra top spacing and duplicated indentation because Word list paragraphs were converted into generated lists while still carrying conflicting horizontal spacing. After this change, the pasted nested list layout aligns more closely with the source Word content.
Screenshots
Source
Before
After
How to test
Run the full test suite:
Paste the Word Desktop nested bullets sample into the editor.
Validation
yarn test:fastpassed locally withTOTAL: 6483 SUCCESS.