OfficeIMO.Markdown.Html
0.1.42
Prefix Reserved
dotnet add package OfficeIMO.Markdown.Html --version 0.1.42
NuGet\Install-Package OfficeIMO.Markdown.Html -Version 0.1.42
<PackageReference Include="OfficeIMO.Markdown.Html" Version="0.1.42" />
<PackageVersion Include="OfficeIMO.Markdown.Html" Version="0.1.42" />
<PackageReference Include="OfficeIMO.Markdown.Html" />
paket add OfficeIMO.Markdown.Html --version 0.1.42
#r "nuget: OfficeIMO.Markdown.Html, 0.1.42"
#:package OfficeIMO.Markdown.Html@0.1.42
#addin nuget:?package=OfficeIMO.Markdown.Html&version=0.1.42
#tool nuget:?package=OfficeIMO.Markdown.Html&version=0.1.42
OfficeIMO.Markdown.Html - HTML to Markdown conversion
OfficeIMO.Markdown.Html converts HTML fragments or full HTML documents into Markdown text and OfficeIMO.Markdown document models.
Install
dotnet add package OfficeIMO.Markdown.Html
Quick start
using OfficeIMO.Markdown;
using OfficeIMO.Markdown.Html;
string markdown = "<h1>Hello</h1><p>Body</p>".ToMarkdown();
MarkdownDoc document = "<h1>Hello</h1><p>Body</p>".LoadFromHtml();
Options
using OfficeIMO.Markdown.Html;
var options = new HtmlToMarkdownOptions {
BaseUri = new Uri("https://example.com/docs/"),
UseBodyContentsOnly = true,
PreserveUnsupportedBlocks = true,
PreserveUnsupportedInlineHtml = true,
SmartHref = true
};
string markdown = "<p><a href=\"guide/start\">Docs</a></p>".ToMarkdown(options);
Compatibility controls
var options = new HtmlToMarkdownOptions {
SmartHref = true,
UnknownBlockHandling = HtmlUnknownTagHandling.Bypass,
UnknownInlineHandling = HtmlUnknownTagHandling.Bypass
};
options.ExcludeSelectors.Add(".ad, .cookie-banner");
options.TagAliases["highlight"] = "mark";
options.PassThroughTags.Add("custom-widget");
string markdown = html.ToMarkdown(options);
SmartHrefemits self-describing links such as<a href="https://example.com">https://example.com</a>as plain text.ExcludeSelectorsandElementFiltersremove matching HTML before conversion.TagAliaseslets custom or legacy tag names reuse built-in converters.PassThroughTagspreserves selected elements as raw HTML.UnknownBlockHandlingandUnknownInlineHandlingchoose whether unknown elements are preserved, bypassed, dropped, or rejected.
What it maps
- Headings, paragraphs, ordered and unordered lists, block quotes, code blocks, horizontal rules, tables, images, figures, details/summary, definition lists, and raw HTML fallback blocks.
- Emphasis, strong emphasis, strike-through, code spans, links, images, line breaks, and selected inline HTML wrappers.
- Relative links and image targets when a base URI is supplied.
- Shared
data-omd-*visual host elements back into semantic fenced blocks when host hints are registered. - Custom block and inline converters for host or plug-in packages.
Profiles
- Use the OfficeIMO profile when the downstream consumer is
OfficeIMO.MarkdownorOfficeIMO.MarkdownRenderer. - Use the GitHub Flavored Markdown profile for README and GitHub documentation output.
- Use the CommonMark profile when output should avoid GitHub-only constructs such as pipe tables; HTML tables are emitted as raw HTML.
- Use the portable profile when output should remain friendly to generic Markdown engines.
var github = HtmlToMarkdownOptions.CreateGitHubFlavoredMarkdownProfile();
string readme = "<p><a href=\"https://example.com\">https://example.com</a></p>".ToMarkdown(github);
var commonMark = HtmlToMarkdownOptions.CreateCommonMarkProfile();
string portableTable = "<table><tr><th>Name</th></tr><tr><td>Value</td></tr></table>".ToMarkdown(commonMark);
Boundaries
- This package owns HTML ingestion into Markdown.
- It does not render Markdown to a host shell; that belongs in
OfficeIMO.MarkdownRenderer. - It does not export to PDF; that belongs in
OfficeIMO.Markdown.PdfandOfficeIMO.Pdf.
Targets and license
- Targets:
netstandard2.0,net8.0,net10.0. - License: MIT.
- Repository: EvotecIT/OfficeIMO
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- OfficeIMO.Html (>= 0.1.11)
- OfficeIMO.Markdown (>= 0.6.42)
-
.NETStandard 2.0
- OfficeIMO.Html (>= 0.1.11)
- OfficeIMO.Markdown (>= 0.6.42)
-
net10.0
- OfficeIMO.Html (>= 0.1.11)
- OfficeIMO.Markdown (>= 0.6.42)
-
net8.0
- OfficeIMO.Html (>= 0.1.11)
- OfficeIMO.Markdown (>= 0.6.42)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on OfficeIMO.Markdown.Html:
| Package | Downloads |
|---|---|
|
OfficeIMO.Word.Markdown
Markdown converter for OfficeIMO.Word - Convert Word documents to/from Markdown using OfficeIMO.Markdown |
|
|
HtmlTinkerX
Package Description |
|
|
OfficeIMO.MarkdownRenderer
WebView-friendly Markdown rendering helpers (shell + incremental updates) built on OfficeIMO.Markdown. |
|
|
OfficeIMO.Reader.Html
HTML adapter for OfficeIMO.Reader using OfficeIMO.Markdown.Html. |
|
|
OfficeIMO.Html.Pdf
Bidirectional HTML/PDF converter for OfficeIMO - Thin adapter over OfficeIMO.Markdown.Html, OfficeIMO.Word.Html, and the first-party OfficeIMO.Pdf logical/read/render engines. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.42 | 369 | 7/9/2026 |
| 0.1.41 | 506 | 7/8/2026 |
| 0.1.40 | 1,035 | 7/5/2026 |
| 0.1.39 | 821 | 7/4/2026 |
| 0.1.38 | 958 | 6/27/2026 |
| 0.1.37 | 778 | 6/27/2026 |
| 0.1.36 | 996 | 6/24/2026 |
| 0.1.35 | 786 | 6/23/2026 |
| 0.1.34 | 908 | 6/21/2026 |
| 0.1.33 | 770 | 6/16/2026 |
| 0.1.32 | 917 | 6/16/2026 |
| 0.1.31 | 739 | 6/15/2026 |
| 0.1.30 | 760 | 6/13/2026 |
| 0.1.29 | 793 | 6/12/2026 |
| 0.1.28 | 613 | 6/9/2026 |
| 0.1.27 | 775 | 6/5/2026 |
| 0.1.26 | 686 | 5/27/2026 |
| 0.1.25 | 558 | 5/26/2026 |
| 0.1.24 | 498 | 5/26/2026 |
| 0.1.23 | 577 | 5/23/2026 |