Skip to content

fix: render horizontal rules in published rich text output#108

Merged
liamwalder merged 2 commits intodevelopfrom
fix/richtext-hr-published-output
Mar 30, 2026
Merged

fix: render horizontal rules in published rich text output#108
liamwalder merged 2 commits intodevelopfrom
fix/richtext-hr-published-output

Conversation

@lunenas
Copy link
Copy Markdown
Collaborator

@lunenas lunenas commented Mar 27, 2026

Summary

Horizontal rules (<hr>) added via the rich text editor were not appearing in the published website HTML, especially on CMS collection pages where rich text field values are expanded inline.

Changes

  • Add horizontalRule handler to renderTiptapToHtml with proper DEFAULT_TEXT_STYLES fallback for consistent styling
  • Add horizontalRule to the isBlockNode check in resolveRichTextVariables so HR nodes are correctly lifted out of paragraphs during CMS rich text variable expansion

Test plan

  • Add an <hr> (type ---) in a rich text layer on a regular page, publish, and verify it appears
  • Add an <hr> in a rich text layer on a CMS collection template page, publish, and verify it appears for each collection item
  • Add an <hr> inside a CMS rich_text field value, publish, and verify it renders in the published output
  • Verify the HR has the default border styling (border-t-[1px] border-[#aeaeae])

Made with Cursor

lunenas and others added 2 commits March 27, 2026 11:54
Add horizontalRule handler to renderTiptapToHtml so <hr> elements
appear in the generated HTML. Also treat horizontalRule as a block
node during CMS rich text variable expansion to prevent it from
being silently dropped inside paragraphs.

Made-with: Cursor
@liamwalder liamwalder merged commit a88a250 into develop Mar 30, 2026
2 checks passed
@liamwalder liamwalder deleted the fix/richtext-hr-published-output branch March 30, 2026 10:55
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.

2 participants