-
Notifications
You must be signed in to change notification settings - Fork 2
Bugfix/cms 46481 fix attributes parsing #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
TRomesh
commented
Nov 3, 2025
- Add support for CSS styles (Some basic styling options) for content created from Integration API.
- Add support HTML Table attributes.
- Add unit test for css conversion.
- Update readme with the information about what we support and what we don't.
…ng in toReactProps function
…ibute and CSS property support, including conversion rules and examples for React compatibility.
There was a problem hiding this 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 enhances the RichText component's attribute handling by adding comprehensive support for HTML-to-React attribute conversion and CSS property management. The changes enable proper rendering of table elements with their attributes and automatic conversion of CSS properties to React style objects.
- Added
TableElementtype andcreateTableComponentfunction for type-safe table rendering - Implemented comprehensive HTML attribute to React prop conversion via
HTML_TO_REACT_ATTRSmapping - Added CSS property detection and automatic conversion to React
styleobjects - Enhanced documentation with detailed attribute and CSS property support reference
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/optimizely-cms-sdk/src/react/richText/lib.ts | Core implementation of attribute conversion logic, TableElement renderer, and CSS property handling |
| packages/optimizely-cms-sdk/src/react/richText/index.ts | Exported new TableElement types and createTableComponent function |
| packages/optimizely-cms-sdk/src/react/test/table-attributes.test.tsx | Tests for table attribute rendering (contains incorrect expectations) |
| packages/optimizely-cms-sdk/src/react/test/attribute-conversion.test.tsx | Tests for HTML attribute to React prop conversion |
| packages/optimizely-cms-sdk/src/components/richText/renderer.ts | Added TableElement interface and attribute mapping |
| packages/optimizely-cms-sdk/src/components/richText/index.ts | Exported TableElement and related types |
| docs/6.1-richtext-component-react.md | Comprehensive documentation of attribute and CSS property support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/optimizely-cms-sdk/src/react/__test__/table-attributes.test.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nd improve CSS properties handling in the library