xoofx / markdig

A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
BSD 2-Clause "Simplified" License
4.21k stars 444 forks source link

Add support for GitHub Markdown Alerts #774

Closed xoofx closed 4 months ago

xoofx commented 5 months ago

See https://github.com/orgs/community/discussions/16925

> [!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.

rendered as:

[!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.

jorge-moreira commented 4 months ago

Hi Alexandre,

The objective here is to support a new type of block (i.e. AlertBlock) with it's own parser and renderer? For the parser I would say that there's no doubt on what to do, although for the renderer I've some doubts on how we would support this to be rendered in html.

I'll be glad to help on.

xoofx commented 4 months ago

Added a tentative PR #776 to implement this feature.

xoofx commented 4 months ago

The objective here is to support a new type of block (i.e. AlertBlock) with it's own parser and renderer? For the parser I would say that there's no doubt on what to do, although for the renderer I've some doubts on how we would support this to be rendered in html.

I'll be glad to help on.

Forgot to respond, as I was reading your question yesterday, and I started to play with a parser to see how problematic it would be to implement it and saw that it was in the end relatively small, so decided to complete the implementation. So, my apologies if I took over and thanks for the proposal for helping, I appreciate. 🙂