Markdown Plain-text formatting

Version CommonMark 0.31.2 · source

Start here

# Title
Heading, level 1
**bold** *italic*
Emphasis
- item
Bullet list
[text](<url>)
Link
![alt](<url>)
Image
`code`
Inline code
> quote
Blockquote
| a | b |
Table (GFM)

Concepts

  1. Plain text .md file
  2. Syntax tree blocks, inlines
  3. HTML or PDF, docs

Headings & text

# H1 ## H2 ### H3
ATX headings, 1 to 6 hashes
**bold** __bold__
Strong emphasis
*italic* _italic_
Emphasis
***both***
Bold and italic
~~text~~
Strikethrough (GFM)
Title =====
Setext heading, H1 (underline with ---: H2)
snake\_case
Backslash escapes a special character
Escapable: \ ` * _ { } [ ] ( ) # + - . ! |
line (two spaces)
Hard line break at end of line
A backslash at line end also breaks; a single newline is just a space.
--- *** ___
Thematic break (horizontal rule)
<!-- note -->
Comment, not rendered
<br>
Raw HTML line break

Lists

- item * item + item
Bullet list
1. item
Ordered list
Only the first number matters: 1. 1. 1. renders as 1. 2. 3.
- nested
Nest by indenting under the item text
- [ ] - [x]
Task list, open and done (GFM)
5. item
Ordered list starting at 5
- a (blank line) - b
Blank line between items makes a loose list
[text](<url>)
Inline link
[text](<url> "title")
Link with hover title
<https://example.com>
Autolink in angle brackets
![alt](<path>)
Image
[![alt](<img>)](<url>)
Image that links
[text][id]
Reference link
[id]: <url> "title"
Define a reference, anywhere in file
[text](#section-name)
Link to a heading anchor (lowercase, hyphens)
https://example.com
Bare URL auto-linked (GFM)

Code & quotes

`code`
Inline code
``a ` b``
Inline code containing a backtick
```<lang>
Fenced code block with language
Close with a matching ``` line; use ~~~ or four backticks to wrap a block containing ```.
code
Indented code block, 4 spaces
> quote
Blockquote
> > nested
Quote inside a quote
> [!NOTE]
Alert: NOTE, TIP, IMPORTANT, WARNING, CAUTION (GitHub)
```diff
Highlight +/- lines as a diff

Tables & extras

| a | b |
Table header row (GFM)
| --- | --- |
Delimiter row, required under the header
| :--- | :---: | ---: |
Align left, centre, right
\|
Literal pipe inside a cell
text[^1]
Footnote reference (GFM)
[^1]: note
Footnote text, anywhere in file
<details><summary>
Collapsible section, raw HTML
$x^2$
Inline math (GitHub, others)
```mermaid
Diagram block (GitHub, others)

Recipes

Minimal README
# ProjectOne-line summary.## Install```shnpm install project```
Table with alignment
| Name | Qty | Price || :--- | --: | ----: || Tea  |   2 |  3.50 |
Collapsible log
<details><summary>Show log</summary>```output here```</details>
Footnote and reference link
See the spec[^1] or the [docs][d].[^1]: CommonMark 0.31.2.[d]: https://commonmark.org "Docs"