Skip to content

Implement HeaderNode component with textarea #275

Closed

Description

@malibio

Overview

Create dedicated HeaderNode component (h1-h6) with textarea-based editing.

Parent Issue: #274 (Textarea migration)

Behavior

Auto-Detection Pattern

When TextNode content starts with # (1-6 hashtags + space):

  • Automatically convert TextNode → HeaderNode
  • Store hashtags in content: ## Hello stored as-is
  • Node type: header

Header Levels

  • # Hello → h1
  • ## Hello → h2
  • ### Hello → h3
  • ... up to h6

User changes level by adding/removing hashtags in real-time.

Real-Time Styling

CSS applied to entire node based on hashtag count:

  • Larger font size for h1-h6
  • Bold weight
  • Appropriate spacing
  • Applied during edit mode (textarea visible with ## syntax)

Inline Formatting

HeaderNode supports inline markdown:
## Hello **bold** world

  • Edit mode: Syntax visible (**bold**)
  • Blur mode: Syntax hidden, formatted (bold)

Single-Line Behavior

  • No multiline support (auto-wrap text)
  • Enter key creates new HeaderNode below (inherits header level)

Conversion Back to TextNode

When user removes all hashtags:
## Hello → Hello = HeaderNode → TextNode

Acceptance Criteria

  • Auto-detect # pattern and convert node type
  • Support h1-h6 levels based on hashtag count
  • Real-time CSS styling during edit mode
  • Inline formatting rendered on blur only
  • Single-line enforced (auto-wrap)
  • Enter creates new HeaderNode below (inherits level)
  • Removing hashtags converts back to TextNode
  • Store hashtags in database content
  • Register HeaderNode in plugin system
  • Tests cover all header levels and conversions
  • Backend accepts header node type (ALLOWED_NODE_TYPES)

Design Reference

See docs/design-system/components.html for header styling specs.

Activity

  1. self-assigned this
    on Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions