Markdig parses and renders Markdown to HTML for .NET applications with a rich AST and optional extensions. It implements CommonMark and many GitHub-flavored additions.
Overview
Markdig is a .NET Markdown processor focused on speed, CommonMark compliance, and extensibility. It builds an abstract syntax tree with precise source positions, which helps editors and analyzers work with the same parse tree as the HTML renderer.
Core parsing covers standard CommonMark constructs plus fenced code blocks and numerous bundled extensions such as tables, task lists, footnotes, mathematics, emoji, YAML or TOML front matter, and Bootstrap CSS class injection.
Round-trip support preserves trivia so documents can be rewritten without unintended whitespace changes. Pipeline configuration lets applications enable only the extensions they need.
Developers reference the NuGet package directly or try behavior on public Markdown comparison sites.
Key features
- Fast parser and HTML renderer without regex
- AST with accurate source code spans
- Twenty-plus optional Markdown extensions
- CommonMark and GFM table support
- Round-trip trivia preserving transforms
- YAML and TOML front matter parsers
Use cases
- Render Markdown content in ASP.NET sites
- Build Markdown-aware editing or lint tools
- Enable GitHub-style extensions in custom pipelines