[PR #782] [MERGED] Add bootstrap alert renderer #1222

Open
opened 2026-01-29 14:51:38 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/782
Author: @Abrynos
Created: 3/15/2024
Status: Merged
Merged: 3/18/2024
Merged by: @xoofx

Base: masterHead: bootstrap-alerts


📝 Commits (2)

📊 Changes

1 file changed (+37 additions, -1 deletions)

View changed files

📝 src/Markdig/Extensions/Bootstrap/BootstrapExtension.cs (+37 -1)

📄 Description

Thank you for considering the inclusion of this merge request.

Closes #781

For testing I used the following MD:

# TODO

> [!NOTE]
> This is the newly generated NOTE block
> 
> And this is the second paragraph

> [!TIP]
> This is the newly generated TIP block
>
> And this is the second paragraph

> [!IMPORTANT]
> This is the newly generated IMPORTANT block
>
> And this is the second paragraph

> [!WARNING]
> This is the newly generated WARNING block
>
> And this is the second paragraph

> [!CAUTION]
> This is the newly generated CAUTION block
> 
> And this is the second paragraph

To produce this HTML:

<h1 id="todo">TODO</h1>
<div class="markdown-alert markdown-alert-note alert alert-primary" role="alert">
<p>This is the newly generated NOTE block</p>
<p style="margin-bottom: 0">And this is the second paragraph</p>
</div>
<div class="markdown-alert markdown-alert-tip alert alert-success" role="alert">
<p>This is the newly generated TIP block</p>
<p style="margin-bottom: 0">And this is the second paragraph</p>
</div>
<div class="markdown-alert markdown-alert-important alert alert-info" role="alert">
<p>This is the newly generated IMPORTANT block</p>
<p style="margin-bottom: 0">And this is the second paragraph</p>
</div>
<div class="markdown-alert markdown-alert-warning alert alert-warning" role="alert">
<p>This is the newly generated WARNING block</p>
<p style="margin-bottom: 0">And this is the second paragraph</p>
</div>
<div class="markdown-alert markdown-alert-caution alert alert-danger" role="alert">
<p>This is the newly generated CAUTION block</p>
<p style="margin-bottom: 0">And this is the second paragraph</p>
</div>

Which (with my HTML header and footer) looks like this:

image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/xoofx/markdig/pull/782 **Author:** [@Abrynos](https://github.com/Abrynos) **Created:** 3/15/2024 **Status:** ✅ Merged **Merged:** 3/18/2024 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `bootstrap-alerts` --- ### 📝 Commits (2) - [`7132584`](https://github.com/xoofx/markdig/commit/7132584996d820b279bb418d9fe3736f27bc02c9) Add bootstrap alert renderer - [`f9e96bc`](https://github.com/xoofx/markdig/commit/f9e96bc9c9526e6bdae6cb50d53418144958f05b) Apply feedback ### 📊 Changes **1 file changed** (+37 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig/Extensions/Bootstrap/BootstrapExtension.cs` (+37 -1) </details> ### 📄 Description Thank you for considering the inclusion of this merge request. Closes #781 For testing I used the following MD: ```markdown # TODO > [!NOTE] > This is the newly generated NOTE block > > And this is the second paragraph > [!TIP] > This is the newly generated TIP block > > And this is the second paragraph > [!IMPORTANT] > This is the newly generated IMPORTANT block > > And this is the second paragraph > [!WARNING] > This is the newly generated WARNING block > > And this is the second paragraph > [!CAUTION] > This is the newly generated CAUTION block > > And this is the second paragraph ``` To produce this HTML: ```html <h1 id="todo">TODO</h1> <div class="markdown-alert markdown-alert-note alert alert-primary" role="alert"> <p>This is the newly generated NOTE block</p> <p style="margin-bottom: 0">And this is the second paragraph</p> </div> <div class="markdown-alert markdown-alert-tip alert alert-success" role="alert"> <p>This is the newly generated TIP block</p> <p style="margin-bottom: 0">And this is the second paragraph</p> </div> <div class="markdown-alert markdown-alert-important alert alert-info" role="alert"> <p>This is the newly generated IMPORTANT block</p> <p style="margin-bottom: 0">And this is the second paragraph</p> </div> <div class="markdown-alert markdown-alert-warning alert alert-warning" role="alert"> <p>This is the newly generated WARNING block</p> <p style="margin-bottom: 0">And this is the second paragraph</p> </div> <div class="markdown-alert markdown-alert-caution alert alert-danger" role="alert"> <p>This is the newly generated CAUTION block</p> <p style="margin-bottom: 0">And this is the second paragraph</p> </div> ``` Which (with my HTML header and footer) looks like this: ![image](https://github.com/xoofx/markdig/assets/6608231/ce13fcf2-8812-4040-bdc6-8c6214f726d3) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 14:51:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1222