Skip to content

Extract shared findStyleTagIndexes helper for paste HTML parsing#3349

Draft
JiuqingSong wants to merge 1 commit into
masterfrom
refactor/share-style-tag-extractor
Draft

Extract shared findStyleTagIndexes helper for paste HTML parsing#3349
JiuqingSong wants to merge 1 commit into
masterfrom
refactor/share-style-tag-extractor

Conversation

@JiuqingSong
Copy link
Copy Markdown
Collaborator

Summary

  • Both cleanHtmlComments.ts (in roosterjs-content-model-core) and getStyleMetadata.ts (in roosterjs-content-model-plugins) defined nearly identical private extractHtmlIndexes functions plus matching <style> / </style> / /\W/ constants.
  • Consolidated them into a single findStyleTagIndexes utility exported from roosterjs-content-model-dom/lib/domUtils/findStyleTagIndexes.ts.
  • Net change: +39 / -42 lines (4 files).

Test plan

  • yarn eslint
  • yarn test:fast (5859 specs, 0 failures)

🤖 Generated with Claude Code

Both cleanHtmlComments.ts (core) and getStyleMetadata.ts (plugins) had
nearly identical extractHtmlIndexes functions and matching <style> tag
constants. Consolidate them into a single findStyleTagIndexes utility
exported from roosterjs-content-model-dom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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