Skip to content

Filter temporary EOP elements in Word Online paste and add test pattern support#3283

Open
BryanValverdeU wants to merge 2 commits intomasterfrom
u/bvalverde/addUnitTestsAndFixPasteBug
Open

Filter temporary EOP elements in Word Online paste and add test pattern support#3283
BryanValverdeU wants to merge 2 commits intomasterfrom
u/bvalverde/addUnitTestsAndFixPasteBug

Conversation

@BryanValverdeU
Copy link
Contributor

Filter temporary EOP elements in Word Online paste and add test pattern support

  • Skip elements with both 'Selected' and 'EOP' classes during WAC paste processing to remove temporary End of Paragraph markers
  • Add unit tests for EOP element filtering behavior (3 test cases)
  • Enhance test runner with --testPathPattern and --testNamePattern flags for faster targeted test execution

Before
image

After
image

…rn support

- Skip elements with both 'Selected' and 'EOP' classes during WAC paste processing to remove temporary End of Paragraph markers
- Add unit tests for EOP element filtering behavior (3 test cases)
- Enhance test runner with --testPathPattern and --testNamePattern flags for faster targeted test execution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

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 improves Word Online (WAC) paste sanitization by filtering out temporary End-of-Paragraph marker elements, and adds support for more targeted Karma test runs to speed up local development workflows.

Changes:

  • Skip pasted elements that have both Selected and EOP classes during WAC paste processing.
  • Add unit tests validating the Selected+EOP filtering behavior (and ensuring Selected-only / EOP-only are not filtered).
  • Add --testPathPattern and --testNamePattern options to the fast Karma test config and test loader.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/roosterjs-content-model-plugins/lib/paste/WacComponents/processPastedContentWacComponents.ts Filters out Selected+EOP spans during WAC paste element processing.
packages/roosterjs-content-model-plugins/test/paste/word/processPastedContentFromWacTest.ts Adds coverage for the new filtering behavior with 3 test cases.
karma.fast.conf.js Adds CLI flags intended to narrow test execution by path/name.
tools/karma.test.js Extends test-file selection logic to support testPathPattern and improves reporting.

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

…ts/processPastedContentWacComponents.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

1 participant