Skip to content

Idea: Support highlighted block-quotes for GitHub-flavored Markdown #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pmeinhardt opened this issue Feb 28, 2025 · 3 comments
Closed

Comments

@pmeinhardt
Copy link

Thanks a ton for this library. I'm using it in a small side-project and it works like a charm. 💖

I was wondering…

GitHub supports highlighting block-quotes, for example:

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.

Maybe markdown-rs could support these when rendering using the gfm options?

Cheers and kind regards
Paul

@wooorm
Copy link
Owner

wooorm commented Feb 28, 2025

Hi!

That’s not part of GFM.
It’s part of what GH does after markdown, with HTML. You can see that by observing HTML. Or, by looking at the GFM spec:

<blockquote>
<p>[!NOTE]
Highlights information that users should take into account, even when skimming.</p>
</blockquote>

Note

Highlights information that users should take into account, even when skimming.

Custom plugins on the resulting ASTs are out of scope for the core of this project.
But, this project supports ASTs exactly for these use cases!

All of this already exists in JavaScript (https://github.com/rehypejs/rehype-github/tree/main/packages/alert specifically).
For plugins, that would be #32!

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2025
@pmeinhardt
Copy link
Author

Ah, I see. I should've done a more thorough investigation. Thanks a ton @wooorm for taking the time to provide such a detailed response and helpful pointers. ❤

@wooorm
Copy link
Owner

wooorm commented Feb 28, 2025

Thank you, as well, for your kind words!

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

No branches or pull requests

2 participants