Skip to content

[Feature] Support foldable callout blocks #5223

Closed as duplicate
Closed as duplicate

Description

@Awaker-OTE

Summary

Add styled, optionally foldable callout blocks based on blockquote markers such as > [!NOTE], with an accessible disclosure control.

Problem it solves

Long Markdown documents often need visually distinct notes, warnings, examples, and collapsible supporting details. Plain blockquotes do not communicate semantic intent or allow a reader to collapse secondary content.

Proposed solution

Recognize these types: NOTE, TIP, WARNING, CAUTION, IMPORTANT, INFO, SUCCESS, DANGER, BUG, EXAMPLE, and QUOTE.

  • [!TYPE] renders a non-foldable callout.
  • [!TYPE]+ starts expanded.
  • [!TYPE]- starts collapsed.
  • A real button exposes aria-expanded and supports mouse, Enter, and Space.
  • The marker remains ordinary text outside a blockquote callout position.
  • Markdown source round-trips without a private data format.
  • Motion respects prefers-reduced-motion.

Alternatives considered [optional]

Supporting only GitHub's five alert types is narrower and more interoperable. The larger set and +/- folding follow common Obsidian-style callout syntax. Maintainer guidance on the intended compatibility target is welcome before the implementation PR is submitted.

Additional context [optional]

A local implementation includes parser tests, block lifecycle tests, keyboard/focus tests, and seven Chromium end-to-end scenarios.

Activity

  1. YounesJY commented on Sep 5, 2026

    @YounesJY

    +1 from me too. I'd really like to see this land — GitHub-style callouts (> [!NOTE], [!WARNING], etc.) are pretty much standard now across GitHub, GitLab, and Obsidian, and it's a gap that MarkText's live preview just shows them as plain blockquotes.

    On the scope question raised in the issue: I'd lean toward shipping the core GitHub-compatible 5 types (NOTE, TIP, IMPORTANT, WARNING, CAUTION) first, since that's the most interoperable baseline and covers the most common use case. The extended Obsidian-style set and fold/unfold behavior would be a great follow-up, but landing the basic version sooner (even without folding) would already be a big usability win for anyone writing docs/READMEs in MarkText.

  2. Jocs commented on Sep 18, 2026

    @Jocs
    Member

    Thanks for the proposal — and for spelling out the type list and the folding behaviour.

    Callout / admonition blocks are already requested three times over: #1240 (Callouts: success, info, warning, danger), #2115 (Admonition support) and #3764 (Support for GitHub Alerts), the last of which asks for exactly the > [!NOTE] syntax you propose and is the most specific of the three.

    Closing as a duplicate of #3764 so the design discussion — syntax, which types to support, whether folding is part of it, and whether it should be opt-in — happens in one thread. That is consolidation, not a rejection: please post your proposal (and @YounesJY the scope comment above) on #3764, and reference it from any PR.

    Your follow-up issues that build on this (#5226 Callout outline sidebar, and the highlight/comment series) stay open as they are.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions