diff --git a/src/Markdig.Tests/Markdig.Tests.csproj b/src/Markdig.Tests/Markdig.Tests.csproj
index 2068bf5f..49c875fc 100644
--- a/src/Markdig.Tests/Markdig.Tests.csproj
+++ b/src/Markdig.Tests/Markdig.Tests.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/src/Markdig.Tests/Specs/AlertBlockSpecs.generated.cs b/src/Markdig.Tests/Specs/AlertBlockSpecs.generated.cs
new file mode 100644
index 00000000..78cf29c1
--- /dev/null
+++ b/src/Markdig.Tests/Specs/AlertBlockSpecs.generated.cs
@@ -0,0 +1,139 @@
+
+// --------------------------------
+// Alert Blocks
+// --------------------------------
+
+using System;
+using NUnit.Framework;
+
+namespace Markdig.Tests.Specs.AlertBlocks
+{
+ [TestFixture]
+ public class TestExtensionsAlertBlocks
+ {
+ // # Extensions
+ //
+ // This section describes the different extensions supported:
+ //
+ // ## Alert Blocks
+ //
+ // This is supporting the [GitHub Alert blocks](https://github.com/orgs/community/discussions/16925)
+ [Test]
+ public void ExtensionsAlertBlocks_Example001()
+ {
+ // Example 1
+ // Section: Extensions / Alert Blocks
+ //
+ // The following Markdown:
+ // > [!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.
+ //
+ // Should be 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.
+ //
+
+ TestParser.TestSpec("> [!NOTE] \n> Highlights information that users should take into account, even when skimming.\n\n> [!TIP]\n> Optional information to help a user be more successful.\n\n> [!IMPORTANT] \n> Crucial information necessary for users to succeed.\n\n> [!WARNING] \n> Critical content demanding immediate user attention due to potential risks.\n\n> [!CAUTION]\n> Negative potential consequences of an action.", "
\n
Note
\n
Highlights information that users should take into account, even when skimming.
\n
\n
\n
Tip
\n
Optional information to help a user be more successful.
\n
\n
\n
Important
\n
Crucial information necessary for users to succeed.
\n
\n
\n
Warning
\n
Critical content demanding immediate user attention due to potential risks.
\n
\n
\n
Caution
\n
Negative potential consequences of an action.
\n
", "advanced", context: "Example 1\nSection Extensions / Alert Blocks\n");
+ }
+
+ // Example with code blocks and mix formatting:
+ [Test]
+ public void ExtensionsAlertBlocks_Example002()
+ {
+ // Example 2
+ // Section: Extensions / Alert Blocks
+ //
+ // The following Markdown:
+ // > [!NOTE]
+ // > Highlights information that users should take into account, even when skimming.
+ // > Testing rendering for multiple lines
+ // > ```csharp
+ // > var test = "I can also add code to panels
+ // > ```
+ // > `Inline code testing`
+ //
+ // Should be rendered as:
+ //
+ //
Note
+ //
Highlights information that users should take into account, even when skimming.
+ // Testing rendering for multiple lines
+ //
var test = "I can also add code to panels
+ //
+ //
+ //
+
+ TestParser.TestSpec("> [!NOTE]\n> Highlights information that users should take into account, even when skimming.\n> Testing rendering for multiple lines\n> ```csharp\n> var test = \"I can also add code to panels\n> ```\n> `Inline code testing`", "
\n
Note
\n
Highlights information that users should take into account, even when skimming.\nTesting rendering for multiple lines
\n
var test = "I can also add code to panels\n
\n\n
", "advanced", context: "Example 2\nSection Extensions / Alert Blocks\n");
+ }
+
+ // An alert inline (e.g `[!NOTE]`) must come first in a quote block, and must be followed by optional spaces with a new line. If no new lines are found, it will not be considered as an alert block.
+ //
+ // Followed by space and new line:
+ [Test]
+ public void ExtensionsAlertBlocks_Example003()
+ {
+ // Example 3
+ // Section: Extensions / Alert Blocks
+ //
+ // The following Markdown:
+ // > [!NOTE] This is invalid because no new line
+ // > Highlights information that users should take into account, even when skimming.
+ //
+ // Should be rendered as:
+ //
+ //
[!NOTE] This is invalid because no new line
+ // Highlights information that users should take into account, even when skimming.
+ //
+
+ TestParser.TestSpec("> [!NOTE] This is invalid because no new line\n> Highlights information that users should take into account, even when skimming.", "
\n
[!NOTE] This is invalid because no new line\nHighlights information that users should take into account, even when skimming.
\n
", "advanced", context: "Example 3\nSection Extensions / Alert Blocks\n");
+ }
+
+ // Must come first in a quote block:
+ [Test]
+ public void ExtensionsAlertBlocks_Example004()
+ {
+ // Example 4
+ // Section: Extensions / Alert Blocks
+ //
+ // The following Markdown:
+ // > This is not a [!NOTE]
+ // > Highlights information that users should take into account, even when skimming.
+ //
+ // Should be rendered as:
+ //
+ //
This is not a [!NOTE]
+ // Highlights information that users should take into account, even when skimming.
+ //
+
+ TestParser.TestSpec("> This is not a [!NOTE]\n> Highlights information that users should take into account, even when skimming.", "
\n
This is not a [!NOTE]\nHighlights information that users should take into account, even when skimming.
\n
", "advanced", context: "Example 4\nSection Extensions / Alert Blocks\n");
+ }
+ }
+}
diff --git a/src/Markdig.Tests/Specs/AlertBlockSpecs.md b/src/Markdig.Tests/Specs/AlertBlockSpecs.md
new file mode 100644
index 00000000..015c0290
--- /dev/null
+++ b/src/Markdig.Tests/Specs/AlertBlockSpecs.md
@@ -0,0 +1,95 @@
+# Extensions
+
+This section describes the different extensions supported:
+
+## Alert Blocks
+
+This is supporting the [GitHub Alert blocks](https://github.com/orgs/community/discussions/16925)
+
+```````````````````````````````` 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.
+.
+
+
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.
+
+````````````````````````````````
+
+Example with code blocks and mix formatting:
+
+
+```````````````````````````````` example
+> [!NOTE]
+> Highlights information that users should take into account, even when skimming.
+> Testing rendering for multiple lines
+> ```csharp
+> var test = "I can also add code to panels
+> ```
+> `Inline code testing`
+.
+
+
Note
+
Highlights information that users should take into account, even when skimming.
+Testing rendering for multiple lines
+
var test = "I can also add code to panels
+
+
+
+````````````````````````````````
+
+An alert inline (e.g `[!NOTE]`) must come first in a quote block, and must be followed by optional spaces with a new line. If no new lines are found, it will not be considered as an alert block.
+
+Followed by space and new line:
+
+```````````````````````````````` example
+> [!NOTE] This is invalid because no new line
+> Highlights information that users should take into account, even when skimming.
+.
+
+
[!NOTE] This is invalid because no new line
+Highlights information that users should take into account, even when skimming.
+
+````````````````````````````````
+
+Must come first in a quote block:
+
+```````````````````````````````` example
+> This is not a [!NOTE]
+> Highlights information that users should take into account, even when skimming.
+.
+
+
This is not a [!NOTE]
+Highlights information that users should take into account, even when skimming.
+
+````````````````````````````````
+
+
diff --git a/src/Markdig.Tests/Specs/MathSpecs.generated.cs b/src/Markdig.Tests/Specs/MathSpecs.generated.cs
index 35eca3ba..ee0a291c 100644
--- a/src/Markdig.Tests/Specs/MathSpecs.generated.cs
+++ b/src/Markdig.Tests/Specs/MathSpecs.generated.cs
@@ -279,7 +279,7 @@ public class TestExtensionsMathBlock
{
// ## Math Block
//
- // The match block can spawn on multiple lines by having a $$ starting on a line.
+ // The math block can spawn on multiple lines by having a $$ starting on a line.
// It is working as a fenced code block.
[Test]
public void ExtensionsMathBlock_Example017()
diff --git a/src/Markdig/Extensions/Alerts/AlertBlock.cs b/src/Markdig/Extensions/Alerts/AlertBlock.cs
new file mode 100644
index 00000000..4e5ff529
--- /dev/null
+++ b/src/Markdig/Extensions/Alerts/AlertBlock.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Alexandre Mutel. All rights reserved.
+// This file is licensed under the BSD-Clause 2 license.
+// See the license.txt file in the project root for more information.
+
+using Markdig.Helpers;
+using Markdig.Syntax;
+
+namespace Markdig.Extensions.Alerts;
+
+///
+/// A block representing an alert quote block.
+///
+public class AlertBlock : QuoteBlock
+{
+ ///
+ /// Creates a new instance of this block.
+ ///
+ ///
+ public AlertBlock(StringSlice kind) : base(null)
+ {
+ Kind = kind;
+ }
+
+ ///
+ /// Gets or sets the kind of the alert block (e.g `NOTE`, `TIP`, `IMPORTANT`, `WARNING`, `CAUTION`)
+ ///
+ public StringSlice Kind { get; set; }
+
+ ///
+ /// Gets or sets the trivia space after the kind.
+ ///
+ public StringSlice TriviaSpaceAfterKind { get; set; }
+}
diff --git a/src/Markdig/Extensions/Alerts/AlertBlockRenderer.cs b/src/Markdig/Extensions/Alerts/AlertBlockRenderer.cs
new file mode 100644
index 00000000..f9b95d61
--- /dev/null
+++ b/src/Markdig/Extensions/Alerts/AlertBlockRenderer.cs
@@ -0,0 +1,79 @@
+// Copyright (c) Alexandre Mutel. All rights reserved.
+// This file is licensed under the BSD-Clause 2 license.
+// See the license.txt file in the project root for more information.
+
+using Markdig.Helpers;
+using Markdig.Renderers;
+using Markdig.Renderers.Html;
+using Markdig.Syntax;
+
+namespace Markdig.Extensions.Alerts;
+
+///
+/// A HTML renderer for a .
+///
+///
+public class AlertBlockRenderer : HtmlObjectRenderer
+{
+ ///
+ /// Creates a new instance of this renderer.
+ ///
+ public AlertBlockRenderer()
+ {
+ RenderKind = DefaultRenderKind;
+ }
+
+ ///
+ /// Gets of sets a delegate to render the kind of the alert.
+ ///
+ public Action RenderKind { get; set; }
+
+
+ ///
+ protected override void Write(HtmlRenderer renderer, AlertBlock obj)
+ {
+ renderer.EnsureLine();
+ if (renderer.EnableHtmlForBlock)
+ {
+ renderer.Write("