Soenneker.Extensions.String.Markdown
4.0.865
Prefix Reserved
dotnet add package Soenneker.Extensions.String.Markdown --version 4.0.865
NuGet\Install-Package Soenneker.Extensions.String.Markdown -Version 4.0.865
<PackageReference Include="Soenneker.Extensions.String.Markdown" Version="4.0.865" />
<PackageVersion Include="Soenneker.Extensions.String.Markdown" Version="4.0.865" />
<PackageReference Include="Soenneker.Extensions.String.Markdown" />
paket add Soenneker.Extensions.String.Markdown --version 4.0.865
#r "nuget: Soenneker.Extensions.String.Markdown, 4.0.865"
#:package Soenneker.Extensions.String.Markdown@4.0.865
#addin nuget:?package=Soenneker.Extensions.String.Markdown&version=4.0.865
#tool nuget:?package=Soenneker.Extensions.String.Markdown&version=4.0.865
Soenneker.Extensions.String.Markdown
Convert Markdown to HTML with Markdig's advanced extensions, with an optional Blazor MarkupString result.
Installation
dotnet add package Soenneker.Extensions.String.Markdown
Convert to HTML
using Soenneker.Extensions.String.Markdown;
string markdown = "# Hello, World!";
string html = markdown.ToHtml();
// <h1 id="hello-world">Hello, World!</h1>
The shared Markdig pipeline enables advanced extensions such as tables, task lists, auto-identifiers, footnotes, and emphasis extras. ToHtml() returns null for null, "" for an empty string, and preserves whitespace-only input unchanged.
Render in Blazor
@using Soenneker.Extensions.String.Markdown
@code {
private readonly MarkupString _html = "# Hello, World!".ToHtmlMarkup();
}
@_html
ToHtmlMarkup() returns the generated HTML wrapped in Microsoft.AspNetCore.Components.MarkupString. Null, empty, and whitespace-only input produce the default MarkupString.
Security
Markdown conversion is not sanitization. Markdig can preserve raw HTML and generate links from input, while Blazor treats MarkupString as trusted markup and does not HTML-encode it. Do not pass untrusted Markdown directly to ToHtmlMarkup(). Sanitize the generated HTML with an allowlist-based HTML sanitizer before rendering it in a browser.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Markdig (>= 1.4.2)
- Microsoft.AspNetCore.Components (>= 10.0.13)
- Soenneker.Extensions.String (>= 4.0.799)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.865 | 80 | 10/20/2026 |
| 4.0.864 | 96 | 10/16/2026 |
| 4.0.863 | 96 | 10/15/2026 |
| 4.0.862 | 79 | 10/14/2026 |
| 4.0.861 | 82 | 10/14/2026 |
| 4.0.859 | 82 | 10/14/2026 |
| 4.0.858 | 82 | 10/14/2026 |
| 4.0.851 | 84 | 10/13/2026 |
| 4.0.850 | 79 | 10/12/2026 |
| 4.0.848 | 80 | 10/12/2026 |
| 4.0.847 | 93 | 10/11/2026 |
| 4.0.846 | 85 | 10/11/2026 |
| 4.0.845 | 82 | 10/11/2026 |
| 4.0.844 | 90 | 10/11/2026 |
| 4.0.843 | 100 | 9/30/2026 |
| 4.0.842 | 105 | 9/25/2026 |
| 4.0.841 | 100 | 9/25/2026 |
| 4.0.840 | 100 | 9/24/2026 |
| 4.0.839 | 95 | 9/24/2026 |
| 4.0.838 | 102 | 9/20/2026 |
Update dependency Markdig to 1.4.2 (#1285)