A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
open sourceBSD-2-Clausefree
Markdig is Alexandre Mutel's Markdown processor for .NET: a fast parser and HTML renderer, written without regular expressions and light on the garbage collector, that passes more than 600 tests of the CommonMark 0.31.2 spec. It builds an abstract syntax tree with precise source locations, which suits Markdown editors (Mads Kristensen's Markdown Editor v2 for Visual Studio uses it), supports lossless roundtrip parsing so documents can be changed without disturbing their whitespace, and has a pluggable architecture where even core CommonMark parsing can be turned off. More than 20 built-in extensions add GitHub-style alerts, pipe and grid tables, footnotes, task lists, definition lists, math, emoji, diagrams (Mermaid), YAML and TOML front matter, auto-identifiers, auto-links, a table of contents and more, and third-party packages add syntax highlighting and WPF or Avalonia renderers.
Problems it solves
- render Markdown to HTML in my C# app
- parse Markdown into a syntax tree for a Markdown editor in .NET
- GitHub-flavoured Markdown tables and task lists in .NET
Features
- CommonMark compliant parser and HTML renderer (600+ spec tests)
- abstract syntax tree with precise source locations
- lossless roundtrip parsing
- 20+ extensions: tables, footnotes, task lists, math, emoji, Mermaid diagrams, front matter
- pluggable parsing, including the core CommonMark rules
Alternatives
The same job
These do what Markdig does.
- Showdown Convert Markdown to HTML and HTML back to Markdown in the browser or Node.js