docs(transformHTMLToComponents) - Add some docs#994
docs(transformHTMLToComponents) - Add some docs#994gabrielseco wants to merge 3 commits intoadd-example-and-expose-propfrom
Conversation
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (313 total)
✅ Bundle size check passed |
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9961b5d. Configure here.
| /> | ||
| <BaseFormDescription className='mb-5 RemoteFlows__FieldSetField__Description'> | ||
| {description} | ||
| </BaseFormDescription> |
There was a problem hiding this comment.
FieldSetField description wrapper changed from div to p
High Severity
The FieldSetField description was previously wrapped in a <div>, but BaseFormDescription defaults its element to <p> (via as || 'p'). Since no as prop is passed here, the description HTML will now be nested inside a <p> tag. The HTML spec forbids block-level elements (like <p>, <div>, <details>, <ul>) inside <p>, so the browser auto-closes the <p> and breaks the DOM structure. Other callers like ForcedValueField and CurrencyConversionField correctly pass as='span'. This needs as='div' to preserve the original behavior.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9961b5d. Configure here.


Note
Medium Risk
Introduces a new
transformHtmlToComponentsrendering path for HTML descriptions and changes how descriptions are sanitized/rendered across field components, which could affect UI output and (if misused by consumers) HTML/XSS handling. Touches core form rendering and context plumbing, so regressions would surface broadly across flows.Overview
Adds a new
RemoteFlowsprop,transformHtmlToComponents, and threads it throughFormFieldsContextso form fields andFormDescriptioncan transform sanitized HTML strings into custom React output.Updates all built-in field wrappers to pass
fieldData.transformHtmlto custom components, and refactorsFieldSetField/FormDescriptionto stop usingdangerouslySetInnerHTMLdirectly for fieldset descriptions when possible.Expands documentation and the example app to demonstrate HTML-to-component transformation (accordion example using
html-react-parser+dompurify), adds corresponding example dependencies, and updates tests/mocks to accommodate the new context hook.Reviewed by Cursor Bugbot for commit 70f31e1. Bugbot is set up for automated code reviews on this repo. Configure here.