# Markdown Syntax Cheatsheet
Markdown is a plain-text formatting syntax that renders to HTML. "Markdown" isn't one spec — CommonMark standardized the core rules, and GitHub Flavored Markdown (GFM) layers extensions like tables and task lists on top. This sheet covers both and flags where a renderer might not support a feature.
| Syntax | Renders as |
|---|---|
| `# H1` … `###### H6` | Heading levels 1–6 |
| `**bold**` or `__bold__` | **bold** |
| `*italic*` or `_italic_` | *italic* |
| `***bold italic***` | ***bold italic*** |
| `~~strikethrough~~` (GFM) | ~~strikethrough~~ |
| `` `inline code` `` | `inline code` |
| Syntax | Result |
|---|---|
| `- item` or `* item` | Unordered list |
| `1. item` | Ordered list (numbers auto-increment even if you write `1.` repeatedly) |
| ` - nested` | Nested list (indent 2+ spaces under the parent marker) |
| `- [ ] todo` / `- [x] done` (GFM) | Task list checkbox |
| Syntax | Result |
|---|---|
| `[text](url)` | Link |
| `[text](url "title")` | Link with hover tooltip |
| `` | Image |
| `[text][ref]` … `[ref]: url` | Reference-style link (keeps prose readable, definitions can live at the bottom) |
| `<https://example.com>` | Auto-linked bare URL |
const x = 1;
The optional language after the opening fence ( `javascript ) enables syntax highlighting in renderers that support it — it has no effect on the raw text itself.
| Left | Center | Right |
|:---|:---:|---:|
| a | b | c |
The colons in the separator row control column alignment: left (:---), center (:---:), right (---:).
| Syntax | Result |
|---|---|
| `> quoted text` | Blockquote |
| `> > nested quote` | Nested blockquote |
| `---`, `***`, or `___` on its own line | Horizontal rule |
\*not italic\*
Any ASCII punctuation character can be escaped with a leading backslash to render literally instead of being interpreted as syntax — the ones you'll actually need this for are ` \*_{}[]()#+-.! ``, but CommonMark's full escapable set is every ASCII punctuation character, not just these.
1. Run the setup script:
```bash
npm install
```
2. Then start the server.
The fence must be indented to align with the list item's content, or most parsers will end the list before the code block.
Line one.
Line two.
A single newline is not a line break in rendered output — CommonMark collapses it into one paragraph with a space. To force a hard break, end the line with two or more trailing spaces, or use <br>.
3. item starting a list will render starting at 3, not 1 — a common surprise when reordering list items by hand.1. is 3 characters, so nested content needs 3-space indent) — inconsistent indentation can either flatten the nesting or break out of the list entirely, with no error shown.<div>/<script> working the same way everywhere your Markdown gets rendered.