Filter temporary EOP elements in Word Online paste and add test pattern support#3283
Open
BryanValverdeU wants to merge 2 commits intomasterfrom
Open
Filter temporary EOP elements in Word Online paste and add test pattern support#3283BryanValverdeU wants to merge 2 commits intomasterfrom
BryanValverdeU wants to merge 2 commits intomasterfrom
Conversation
…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>
Contributor
There was a problem hiding this comment.
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
SelectedandEOPclasses during WAC paste processing. - Add unit tests validating the
Selected+EOPfiltering behavior (and ensuringSelected-only /EOP-only are not filtered). - Add
--testPathPatternand--testNamePatternoptions 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.
...roosterjs-content-model-plugins/lib/paste/WacComponents/processPastedContentWacComponents.ts
Outdated
Show resolved
Hide resolved
…ts/processPastedContentWacComponents.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Filter temporary EOP elements in Word Online paste and add test pattern support
Before

After
