Enable with .UseEmphasisExtras() (included in UseAdvancedExtensions()).
This extension adds several emphasis styles beyond standard bold and italic.
Wrap text with ~~ for strikethrough:
This is ~~deleted~~ text.
This is deleted text.
Wrap text with ~ for subscript:
H~2~O is water.
H2O is water.
Wrap text with ^ for superscript:
2^10^ is 1024.
210 is 1024.
Wrap text with ++ for inserted/underlined text:
This text has been ++inserted++.
This text has been inserted.
Wrap text with == for marked/highlighted text:
This is ==highlighted== text.
This is highlighted text.
| Syntax | HTML output |
|---|---|
~~text~~ |
<del>text</del> |
~text~ |
<sub>text</sub> |
^text^ |
<sup>text</sup> |
++text++ |
<ins>text</ins> |
==text== |
<mark>text</mark> |
By default, all emphasis extras are enabled. Use EmphasisExtraOptions to enable only specific ones:
using Markdig.Extensions.EmphasisExtras;
var pipeline = new MarkdownPipelineBuilder()
.UseEmphasisExtras(EmphasisExtraOptions.Strikethrough | EmphasisExtraOptions.Superscript)
.Build();
Available options:
EmphasisExtraOptions.StrikethroughEmphasisExtraOptions.SubscriptEmphasisExtraOptions.SuperscriptEmphasisExtraOptions.InsertedEmphasisExtraOptions.MarkedEmphasisExtraOptions.Default (all of the above)