Skip to content

Markdown preview doesn't render callouts / GitHub-style alerts (> [!note]) #8441

Closed

Description

@congee949

Summary

The built-in Markdown preview renders Obsidian/GitHub callout (alert) blockquotes as plain blockquotes. A block like > [!note] shows the literal [!note] marker instead of a styled callout. This makes notes authored in Obsidian (which relies heavily on callouts) hard to read inside Orca.

Steps to reproduce

Open a .md file containing:

> [!note] Optional title
> Body text of the callout.

> [!warning]
> Another one.

Expected: styled callout boxes (icon + colored border/title), marker line consumed.
Actual: ordinary blockquotes; the [!note] / [!warning] text is shown verbatim.

Root cause (from inspecting the shipped renderer bundle, v1.4.137)

The preview's react-markdown pipeline is:

  • remark: remark-parse, remark-gfm, remark-frontmatter, remark-breaks, remark-math, plus the custom wikilink plugin
  • rehype: rehype-raw, rehype-sanitize (with defaultSchema), rehype-slug, rehype-highlight, rehype-katex

remark-gfm does not implement alert/callout blockquotes — those need a dedicated plugin. There's currently no alert/callout plugin in the chain, so > [!type] falls through as a blockquote.

Proposed fix

Add one plugin to the existing pipeline:

  • Minimal (GitHub alert subset — NOTE/TIP/IMPORTANT/WARNING/CAUTION): add remark-github-blockquote-alert to remarkPlugins (it ships matching CSS).
  • Fuller (Obsidian superset — arbitrary types, inline title on the marker line, foldable [!note]- / [!note]+): a small remark/rehype transform that rewrites a blockquote whose first paragraph starts with /^\[!(\w+)\]([+-]?)\s?(.*)/ into a div.callout.callout-<type>.

Implementation note (gotcha)

Because the pipeline runs rehype-sanitize with defaultSchema, the added callout div / className will be stripped unless you either (a) run the transform after sanitize, or (b) extend the sanitize schema to allow the callout element + class names. Worth accounting for so the styling doesn't silently disappear.

Environment

Orca 1.4.137, macOS (Apple Silicon).

Activity

  1. added
    enhancement
    on Jul 27, 2026
  2. added a commit that references this issue on Jul 27, 2026
    c9f2590
  3. EdgerHao commented on Nov 19, 2026

    @EdgerHao
    Contributor

    +1. Worth noting markdown-it-obsidian-callouts (Apache-2.0) already reproduces Obsidian's element structure and CSS class names (.callout[data-callout] …), so preview rendering and theming would carry over with it. Umbrella request: #44539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions