Skip to content

Supported Markdown

Pavel edited this page Oct 19, 2026 · 6 revisions

English | Русский

Everything the viewer draws, one row per Markdown element: every way to write it, what turns it on and which sets include it. An element is drawn the same way however it is written. How the viewer draws a document in general is in How It Renders.

What turns an element on:

  • always — the viewer draws it with any Markdig pipeline;
  • UseXxx() — an extension of Markdig in the default pipeline: on by default, and a pipeline of your own without it turns the element off;
  • md:Xxx — a ready-made extension of the viewer: off by default, connected in one line or as a part of a set.

Text

Element Written as Turned on by In sets
Bold, italic **bold**, __bold__, *italic*, _italic_
<b>, <strong>, <i>, <em>
always
Strikethrough ~~text~~
<s>, <del>, <strike>
UseEmphasisExtras()
always
Subscript, superscript H~2~O, x^2^
<sub>, <sup>
UseEmphasisExtras()
always
Marked text ==text==
<mark>
UseEmphasisExtras()
always
Inserted text ++text++
<ins>, <u>
UseEmphasisExtras()
always
Title of a work ""title""
<cite>
UseCitations()
always
Inline code `code`
<code>
always
Key <kbd>Ctrl</kbd> always
Abbreviation — a tooltip with the expansion on every use *[HTML]: HyperText Markup Language UseAbbreviations()
Line break two spaces or \ at the end of a line
<br>
always
Character reference &copy;, &laquo; always
Typographic replacements "quotes", --, ---, ..., <<, >> UseSmartyPants(), off by default — see below
Emoji :smile: — GitHub names; :) stays text md:EmojiShortcodes GitHub, GitLab, Chat
Chip ::text::, ::text::{.success} md:Chips
Color code — a circle of the color next to the code `#0969DA`, `rgb(9, 105, 218)`, `hsl(212, 92%, 45%)` kit:ColorChips GitHub, GitLab
Review marks {++added++}, {--removed--}, {~~old~>new~~}, {==marked==}, {>>comment<<} md:CriticMarkup
Spoiler ||text|| md:Spoilers Chat
Formula — shown as its source text $x^2$
$$ … $$ — as a code block
UseMathematics()

Links and media

Element Written as Turned on by In sets
Link [text](address "title"), [text][id] with [id]: address
<https://example.com>, <user@example.com>
www.example.com, https://example.com in text
[Heading text] — to the heading with this text
<a href="…" title="…">
always
always
UseAutoLinks()
UseAutoIdentifiers()
always
Heading anchor automatic, like on GitHub
Markdig's own identifier
## Title {#id}
always
UseAutoIdentifiers()
UseGenericAttributes()
Image ![alt](address "title")
size {width=120 height=40}
<img>, <a href><img></a>, <picture>
always
UseGenericAttributes()
always
Embedded image ![[picture.png]], ![[picture.png|200]] md:WikiEmbeds Obsidian
Wiki link [[Page]], [[Page#Section]], [[Page|label]], [[#Heading]] md:WikiLinks Obsidian
Tag #tag, #nested/tag md:Tags Obsidian
Mention @name md:Mentions GitHub, Chat
Issue link #123, org/repo#45, PROJ-45 — by your templates md:IssueLinks GitHub, GitLab
Video card — a preview, a title, a play icon [![alt](preview)](video address), ![alt](video address) — YouTube, Vimeo, RuTube
{{< youtube id >}}, {%youtube id %}, {{< vimeo id >}}
md:VideoCards
md:Shortcodes

HackMD
Link card {{< gist user id >}}, {% pdf address %} md:Shortcodes HackMD
Your own shortcode {{< name arguments >}}, {% name arguments %} md:Shortcodes and your handler HackMD

Without md:VideoCards a link to a video is an ordinary image: the address of a video is not a picture, so its alt text is shown.

Blocks

Element Written as Turned on by In sets
Heading # Title … ###### Title
Title underlined with === or ---
<h1> … <h6>
always
Paragraph text; a line break in the source is a line break on the screen always
Quote > text always
Callout — a bar, an icon, a title in the color of its kind > [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION] and any other kind
> [!tip] Title, folded > [!faq]-, unfolded > [!todo]+
!!! note "Title", folded ??? note, unfolded ???+ note
:::tip Title, :::danger[Title]
UseAlertBlocks()
md:ObsidianCallouts
md:MkDocsAdmonitions
md:CalloutContainers

Obsidian
MkDocs
Docusaurus, HackMD
Collapsible block <details><summary>Title</summary> … </details>, <details open>
:::details Title, :::spoiler Title
always
md:CalloutContainers

Docusaurus, HackMD
Code block ```lang … ```, ~~~
indented by four spaces
always
Diagram code — shown as a code block; drawing it is up to your extension ```mermaid UseDiagrams()
Horizontal rule ---, ***, ___ always
Table of contents [TOC], [[_TOC_]], [[toc]] as a paragraph
{{< toc >}}
md:TableOfContents
md:Shortcodes
GitLab, HackMD
HackMD
Container — shown as its content; an extension can draw it its own way :::name … ::: UseCustomContainers()
Aligned blocks <p align="center">, <div align="right">, <center> always
Figure — the content centered, a caption under it ^^^ … ^^^ Caption UseFigures()
Footer — small text ^^ text UseFooters()

Lists and tables

Element Written as Turned on by In sets
List - item, * item, 1. item, 7) item always
Lettered and roman list a. item, A. item, i. item, I. item UseListExtras()
Task - [ ] task, - [x] task UseTaskLists()
Task status - [/], - [-], - [>], - [?], - [!] md:TaskStatuses Obsidian
Definition list a term on its own line, : definition on the next one UseDefinitionLists()
Table | a | b | with |---|---|; alignment :---, :---:, ---: UsePipeTables()
Grid table — a cell can hold several paragraphs, a list or code and span several columns drawn with +---+ and |; the header is the rows above +===+ UseGridTables()
Table from CSV ```csv, ```tsv kit:CsvTables

Notes and service blocks

Element Written as Turned on by In sets
Footnote [^1] and [^1]: text UseFootnotes()
Footnote in a tooltip the same md:FootnoteTips
Front matter — not drawn, the text is in FrontMatter --- … --- at the start of the document UseYamlFrontMatter()
Properties card — front matter as a «key — value» table the same md:PropertiesCard GitHub, Obsidian
Comment — not drawn <!-- comment -->
%%comment%%, a block between %% lines
always
md:Comments

Obsidian

HTML

The viewer draws HTML by meaning when it knows every tag of an HTML block; an unknown tag is shown as text — see How It Renders.

Where Tags
blocks <details>, <summary>, <p align>, <div align>, <center>, <h1> … <h6>
inside a line <a href title>, <img src alt width height title>, <picture> with <source>, <br>, <b>, <strong>, <i>, <em>, <s>, <del>, <strike>, <code>, <kbd>, <sub>, <sup>, <mark>, <ins>, <u>, <cite>

Turning elements on and off

Markdig elements. The viewer parses with the default pipeline UseAdvancedExtensions() + UseYamlFrontMatter(). MarkdownPipeline replaces it with yours: an element whose UseXxx() is not in your pipeline is not parsed and is shown as plain text. Keep UseYamlFrontMatter(): without it front matter is read as Markdown — a rule and a heading.

MainWindow.xaml.cs, in the constructor after InitializeComponent() (using Markdig;):

Viewer.MarkdownPipeline = new MarkdownPipelineBuilder()
    .UsePipeTables()
    .UseTaskLists()
    .UseYamlFrontMatter()
    .Build();

Typographic replacements are off by default, because in technical texts they turn --force into «–force». They are switched on in your own pipeline, and the table of replacements comes from there — its values are HTML entities.

MainWindow.xaml.cs, in the constructor after InitializeComponent() (using Markdig; using Markdig.Extensions.SmartyPants;):

var typography = new SmartyPantOptions();
typography.Mapping[SmartyPantType.LeftDoubleQuote] = "&laquo;";
typography.Mapping[SmartyPantType.RightDoubleQuote] = "&raquo;";

Viewer.MarkdownPipeline = new MarkdownPipelineBuilder()
    .UseAdvancedExtensions()
    .UseYamlFrontMatter()
    .UseSmartyPants(typography)
    .Build();

With this table "Quote" is shown as «Quote».

Builder settings next to extensions. A viewer with extensions builds its own pipeline: from a ready MarkdownPipeline it takes only the Markdig extensions, and settings of the builder — DisableHtml(), UsePreciseSourceLocation() and the like — are lost. PipelineSetup sets up a fresh builder instead: the extensions of the viewer add their parts on top of it, and MarkdownPipeline is not used.

MainWindow.xaml.cs, in the constructor after InitializeComponent() (using Markdig;):

Viewer.PipelineSetup = builder => builder
    .UseAdvancedExtensions()
    .UseYamlFrontMatter()
    .DisableHtml();

With it <b>bold</b> stays text even next to extensions.

Ready-made extensions are connected one by one, on top of any pipeline.

MainWindow.xaml (xmlns:md="https://github.com/porohkun/Beresta.Markdown.Wpf" on the root element):

<md:MarkdownViewer Markdown="{Binding Text}">
    <md:MarkdownViewer.Extensions>
        <md:Mentions />
        <md:Spoilers />
        <md:EmojiShortcodes />
    </md:MarkdownViewer.Extensions>
</md:MarkdownViewer>

A set connects the extensions of one program at once, and Without leaves some of them out — see Sets.

<md:ObsidianSet Without="Comments, TaskStatuses" />

Beresta.Markdown.Wpf

Basics

Working with Text

Appearance

Integration

Editing

Your Own Syntax

Ready-made Extensions


По-русски

Основы

Работа с текстом

Оформление

Встраивание в приложение

Правка

Свой синтаксис

Готовые расширения

Clone this wiki locally