Skip to content

Fix PowerPoint paste bug with list markers in table cells#3398

Open
BryanValverdeU wants to merge 4 commits into
masterfrom
u/bvalverde/fixPowerPointPasteBug
Open

Fix PowerPoint paste bug with list markers in table cells#3398
BryanValverdeU wants to merge 4 commits into
masterfrom
u/bvalverde/fixPowerPointPasteBug

Conversation

@BryanValverdeU

@BryanValverdeU BryanValverdeU commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Skip list-item processing when the element is a table element (TABLE, THEAD, TBODY, TFOOT, TR, TD, TH); the table check runs before querySelector so table elements containing bullet-styled spans aren't treated as list items.
  • Clear the list marker font size (formatHolder.format.fontSize) so the marker doesn't inherit the list's font size and overflow the table cell.

Scoped to the PowerPoint paste processor only.

Before and after here:
Bug 443376: Copy_paste table from powerpoint looses all formatting when pasted in Monarch

How to test

  1. Copy a list from PowerPoint into a table cell in the editor.
  2. Verify the list marker renders inside the table cell and does not overflow.
  3. Verify tables from PowerPoint are not incorrectly converted to lists.

Skip list-item processing for table elements and clear the list marker
font size so it does not overflow the table cell.

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

github-actions Bot commented Jul 13, 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-3398/

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

BryanValverdeU and others added 2 commits July 13, 2026 15:14
Only remove the list marker font size when the list is inside a table
cell, and add unit tests covering table detection and marker font size.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the PowerPoint paste pre-processing logic so that PowerPoint-generated “bullet marker” spans inside tables don’t cause table elements to be mis-identified as list items, and it adjusts list marker formatting inside table cells to avoid oversized markers overflowing cell bounds.

Changes:

  • Avoid list-item detection on table-related elements (TABLE, THEAD, TBODY, TFOOT, TR, TD, TH) by skipping the bullet-marker query on those tags.
  • When a detected list item is inside a table cell, clear listItem.formatHolder.format.fontSize to prevent marker sizing issues.
  • Add focused unit tests covering list conversion, font-size clearing behavior, and ensuring tables remain tables when they contain bullet markers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/roosterjs-content-model-plugins/lib/paste/PowerPoint/processPastedContentFromPowerPoint.ts Skips bullet-marker detection for table elements and clears list marker font size when inside td/th.
packages/roosterjs-content-model-plugins/test/paste/powerPoint/processPastedContentFromPowerPointTest.ts Adds tests validating list handling for PowerPoint bullets inside/outside tables and preventing table-to-list mis-conversion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants