Skip to content

feat: add horizontal rule support to rich text editor#67

Merged
liamwalder merged 2 commits intodevelopfrom
feat/rich-text-horizontal-rule
Mar 24, 2026
Merged

feat: add horizontal rule support to rich text editor#67
liamwalder merged 2 commits intodevelopfrom
feat/rich-text-horizontal-rule

Conversation

@lunenas
Copy link
Copy Markdown
Collaborator

@lunenas lunenas commented Mar 20, 2026

Summary

Add horizontal rule (separator) support to the rich text editor, allowing
users to insert <hr> elements by typing --- in markdown style.

Changes

  • Add TipTap HorizontalRule extension to the rich text editor formatting extensions
  • Add horizontalRule rendering in renderBlock with styleable classes via text styles
  • Add horizontalRule to DEFAULT_TEXT_STYLES with Separator label and default border styling
  • Add horizontalRule to sublayer icon/name maps so it appears as "Separator" in the layers tree
  • Add contentBlockToStyleKey mapping for horizontalRule so design changes target the HR element
  • Show BorderControls in the right sidebar when a Separator sublayer is selected
  • Add horizontalRule to contentHasBlockElements and extractInlineNodesFromRichText in tiptap-utils
  • Add editor CSS for <hr> inside rich text
  • Update standalone Separator layer template to use border-t-[1px] border-[#aeaeae]

Test plan

  • In a rich text field, type --- on an empty line and press Enter - a horizontal rule appears
  • The separator shows in the layers tree as "Separator" with the separator icon
  • Click the Separator sublayer in the layers tree - it gets selected and BorderControls appear in the right sidebar
  • Adjust border settings on the selected Separator - changes apply to the HR element, not the parent rich text
  • Publish the page - the <hr> renders with correct classes in the published output
  • Add a standalone Separator element from the Element Library - uses the updated border styling

@liamwalder liamwalder merged commit a119b24 into develop Mar 24, 2026
2 checks passed
@liamwalder liamwalder deleted the feat/rich-text-horizontal-rule branch March 24, 2026 07:30
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.

3 participants