Skip to content

Fix borders being incorrectly applied when pasting tables from Word Desktop - #3470

Open
Bryan Valverde U (BryanValverdeU) wants to merge 2 commits into
masterfrom
u/bvalverde/fixWordTableNoBorderPaste
Open

Bryan Valverde U (BryanValverdeU) wants to merge 2 commits into
masterfrom
u/bvalverde/fixWordTableNoBorderPaste

Conversation

@BryanValverdeU

@BryanValverdeU Bryan Valverde U (BryanValverdeU) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: Word Desktop marks table cells/borders with  border: none  in inline styles, but this wasn't being parsed, so the no-border intent was lost and default/inherited borders appeared after paste.
Fix: Added a  wordBorderParser  that detects  border: none  (and per-side variants) in the pasted style and explicitly sets the corresponding  ContentModelTableFormat  properties to  'none'  (previously set to  '' , which didn't correctly suppress borders downstream).

Before
image

After
image

Source
image

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://microsoft.github.io/roosterjs/pr-preview/pr-3470/

Built to branch gh-pages at 2026-10-06 15:13 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Add a Word Desktop border parser that reads the original style attribute and preserves explicit border:none declarations by clearing the corresponding table border formats.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919
@BryanValverdeU
Bryan Valverde U (BryanValverdeU) force-pushed the u/bvalverde/fixWordTableNoBorderPaste branch from 5824c5f to 7e38f92 Compare October 5, 2026 23:45
… paste

Fix unit tests for addParser call counts after adding wordBorderParser

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fc13a30a-b68a-4db8-a3eb-c057f2195fe4
@BryanValverdeU Bryan Valverde U (BryanValverdeU) changed the title U/bvalverde/fix word table no border paste Fix borders being incorrectly applied when pasting tables from Word Desktop Oct 6, 2026
@BryanValverdeU
Bryan Valverde U (BryanValverdeU) marked this pull request as ready for review October 6, 2026 15:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants