You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Github now support admonition blocks
> [!NOTE]> Highlights information that users should take into account, even when skimming.> [!TIP]> Optional information to help a user be more successful.> [!IMPORTANT]> Crucial information necessary for users to succeed.> [!WARNING]> Critical content demanding immediate user attention due to potential risks.> [!CAUTION]> Negative potential consequences of an action.
Note
Highlights information that users should take into account, even when skimming.
Tip
Optional information to help a user be more successful.
Important
Crucial information necessary for users to succeed.
Warning
Critical content demanding immediate user attention due to potential risks.
Caution
Negative potential consequences of an action.
Describe the solution you'd like
Ideally adding a new gfm extension to common-mark makes sense, to support this admonition syntax.
Hey, thanks for raising this! Yeah, this would be useful. It's interesting that it uses link syntax, and that links take precedence, e.g. in this:
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
[!NOTE]: https://example.org
It's actually a link because of the definition.
I'm currently working on support for footnotes, see #273, which needed some more flexibility around link parsing and it has a new API to customize link processing. I think after that is done, admonition parsing should be pretty straightforward.
I don't know how the internal parsing is working, but the context here seems relevant i.e. when parsing the admonition header, we need to know if it's within a block quote.
No updates yet. Happy to prioritize this if someone wants to sponsor the work on this.
Some notes from playing around with it:
This is an admonition block, even with the two empty leading lines inside the block quote (not sure how that's done, is there a special check in block quote parsing, or is the marker detected only later in inline parsing, or as a post-processing step?):
>
>
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
This is not an admonition block though (trailing spaces after the marker are accepted though):
> [!NOTE] Highlights information that users should take into account, even when skimming.
Activity
robinst commentedon Jul 1, 2024
Hey, thanks for raising this! Yeah, this would be useful. It's interesting that it uses link syntax, and that links take precedence, e.g. in this:
It's actually a link because of the definition.
I'm currently working on support for footnotes, see #273, which needed some more flexibility around link parsing and it has a new API to customize link processing. I think after that is done, admonition parsing should be pretty straightforward.
bric3 commentedon Jul 1, 2024
I don't know how the internal parsing is working, but the context here seems relevant i.e. when parsing the admonition header, we need to know if it's within a block quote.
harunagic commentedon Sep 26, 2024
any updates on this?
robinst commentedon Oct 26, 2024
No updates yet. Happy to prioritize this if someone wants to sponsor the work on this.
Some notes from playing around with it:
This is an admonition block, even with the two empty leading lines inside the block quote (not sure how that's done, is there a special check in block quote parsing, or is the marker detected only later in inline parsing, or as a post-processing step?):
This is not an admonition block though (trailing spaces after the marker are accepted though):
ITGungnir commentedon Aug 28, 2025
Found this repo that might help.
AnzhiZhang commentedon Aug 28, 2025
This repo does not have a licence. It defaults to reserving all rights. Cannot simply copy code to this repo, or in theory, we cannot use it.
ITGungnir commentedon Aug 29, 2025
Got it, thanks for the hint.
JakeWharton commentedon Aug 29, 2025
I filed SarahIsWeird/commonmark-ext-alerts#1
[-]GFM admonition blocks[/-][+]GFM admonition blocks (alerts)[/+]robinst commentedon Sep 27, 2025
Thanks @JakeWharton. I added a comment to the issue suggesting we merge it into this repo, I think that would be an even better outcome!
robinst commentedon Mar 31, 2026
Released in 0.28.0 now, thanks for the contribution @ia3andy 🎉!: https://github.com/commonmark/commonmark-java/blob/main/CHANGELOG.md#0280---2026-03-31