Markdig ships with 20+ built-in extensions that go beyond CommonMark. Extensions are enabled via the MarkdownPipelineBuilder fluent API.
Enable all advanced extensions at once:
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.Build();
Or enable specific extensions individually:
var pipeline = new MarkdownPipelineBuilder()
.UsePipeTables()
.UseFootnotes()
.UseMathematics()
.Build();
UseAdvancedExtensions() enables these extensions:
| Extension | Method | Description |
|---|---|---|
| Alert blocks | .UseAlertBlocks() |
GitHub-style [!NOTE], [!TIP], etc. |
| Abbreviations | .UseAbbreviations() |
Abbreviation definitions: *[HTML]: Hyper Text Markup Language |
| Auto-identifiers | .UseAutoIdentifiers() |
Automatic id attributes on headings |
| Citations | .UseCitations() |
Citation text with ""..."" |
| Custom containers | .UseCustomContainers() |
Fenced ::: div containers |
| Definition lists | .UseDefinitionLists() |
<dl> / <dt> / <dd> lists |
| Emphasis extras | .UseEmphasisExtras() |
Strikethrough, sub/superscript, inserted, marked |
| Figures | .UseFigures() |
^^^ figure blocks |
| Footers | .UseFooters() |
^^ footers |
| Footnotes | .UseFootnotes() |
[^ref] footnotes |
| Grid tables | .UseGridTables() |
Pandoc-style grid tables |
| Mathematics | .UseMathematics() |
$...$ inline / $$...$$ block math |
| Media links | .UseMediaLinks() |
Embed YouTube, Vimeo, etc. |
| Pipe tables | .UsePipeTables() |
GitHub-style pipe tables |
| List extras | .UseListExtras() |
Alpha and Roman numeral ordered lists |
| Task lists | .UseTaskLists() |
- [x] / - [ ] checkboxes |
| Diagrams | .UseDiagrams() |
Mermaid, nomnoml diagram blocks |
| Auto-links | .UseAutoLinks() |
Auto-detect http://, www. URLs |
| Generic attributes | .UseGenericAttributes() |
{.class #id key=value} attributes |
| Extension | Method | Description |
|---|---|---|
| Emoji | .UseEmojiAndSmiley() |
:emoji: shortcodes and smileys |
| SmartyPants | .UseSmartyPants() |
Smart quotes, dashes, ellipses |
| Bootstrap | .UseBootstrap() |
Bootstrap CSS classes |
| Hardline breaks | .UseSoftlineBreakAsHardlineBreak() |
Treat soft line breaks as <br> |
| YAML front matter | .UseYamlFrontMatter() |
Parse and discard YAML front matter |
| JIRA links | .UseJiraLinks(options) |
Auto-link Jira issue keys |
| Globalization | .UseGlobalization() |
Right-to-left text support |
| Referral links | .UseReferralLinks(rels) |
Add rel attributes to links |
| Self pipeline | .UseSelfPipeline() |
Auto-configure pipeline from document |
| Pragma lines | .UsePragmaLines() |
Line number pragma IDs |
| Non-ASCII no escape | .UseNonAsciiNoEscape() |
Disable URI escaping for non-ASCII |
Extensions are applied in the order they are added to the builder. Most are order-independent, but UseGenericAttributes() should be added last because it modifies other parsers.
var pipeline = new MarkdownPipelineBuilder()
.UsePipeTables()
.UseFootnotes()
.UseMathematics()
.UseGenericAttributes() // Always last!
.Build();