fix: render proper HTML tags for CMS-bound rich text on canvas#71
Merged
liamwalder merged 2 commits intodevelopfrom Mar 24, 2026
Merged
fix: render proper HTML tags for CMS-bound rich text on canvas#71liamwalder merged 2 commits intodevelopfrom
liamwalder merged 2 commits intodevelopfrom
Conversation
Closes #69 CMS rich-text field content rendered all elements as <span> on the canvas because renderNestedRichTextContent always forced spans. Now the useSpanForParagraphs flag propagates correctly: rich text layers (div) get proper block tags, while restrictive tags (p, h1-h6) keep spans to avoid invalid nesting. Also fix layers tree collapsibility for CMS-bound rich text layers. Made-with: Cursor
liamwalder
approved these changes
Mar 24, 2026
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.
Summary
Fix canvas rendering of CMS-bound rich text fields where all block elements (headings, paragraphs, lists) were incorrectly rendered as
<span>instead of their proper HTML tags. Also fix the layers tree not showing the collapse arrow for CMS-bound rich text layers.Closes #69
Changes
useSpanForParagraphsflag throughrenderInlineContentandrenderNestedRichTextContentinstead of hardcodingtrue<div>) now render CMS content with proper block tags (<h1>,<p>, etc.)<p>, headings) still use<span>to avoid invalid HTML nestinghasRichTextContent()helper that detects CMS field bindings for collapsibility without requiring resolved datahasRichTextContent()inLayersTreefor collapse arrow visibilityTest plan
<h1>-<h6>, paragraphs as<p>, lists as<ul>/<ol>on the canvas<p> cannot be a descendant of <p>console errors<p>text layer bound to a rich-text CMS field still uses<span>(no nesting errors)Made with Cursor