Skip to content

Support Obsidian-style callouts - #1156

Draft
lylo wants to merge 1 commit into
mainfrom
callouts
Draft

Support Obsidian-style callouts#1156
lylo wants to merge 1 commit into
mainfrom
callouts

Conversation

@lylo

@lylo lylo commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Obsidian callout syntax was falling through to a plain blockquote with the [!note] marker visible to readers. Reported by a customer publishing a technical blog from Obsidian.

Fixes #1155

What changed

Markdown. Post::Markdown renders > [!note] Title as <aside data-callout="note"> with the title in its own <p data-callout-title>. Obsidian's full type list is supported, with aliases folded onto the type they render as (important renders as tip, caution as warning) and unrecognised types falling back to note, both matching Obsidian. Adjacent callouts separated only by a blank line are split, working around Redcarpet's Markdown.pl quote merging. Nested callouts work.

Editor. Lexical only keeps elements it has a node for, so without editor support a callout was silently flattened to plain paragraphs on first save. A Lexxy extension (app/javascript/editor/) registers callout and title nodes so callouts round-trip, and adds a toolbar picker (colour swatch per type, next to the quote button). The callout node is a Lexical shadow root, so lists, tables and headings inserted inside a callout stay inside it; a node transform keeps the title as the first child and makes block-format commands no-ops on it. Enter on an empty last line, backspace at the title start, and arrow keys at document edges all leave the callout.

Styling. One definition in lexxy-typography.css serves the editor and published blogs. Digest emails get a coloured left border and bold title in mailer.css.

Sanitisers. aside, data-callout and data-callout-title are allowlisted in ActionText and Html::Sanitize, so callouts survive storage, exports and RSS.

Behaviour changes

  • Posts published from Obsidian with callouts now render styled callouts instead of quotes with a visible marker.
  • The editor toolbar gains a callout button.
  • No changes to existing posts; blockquotes without a marker are untouched.

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.

Add support for callouts from obsidian

1 participant