Markdown Cheat Sheet

Spacing rules that matter in VS Code / CommonMark

Headings

SyntaxRule
# Heading 1 Space required after #. Without it, #Heading is just text.
## Heading 2 Up to ###### (6 levels). Each needs the space.
Blank line before a heading is recommended but not strictly required in CommonMark.

Emphasis

SyntaxResultRule
*italic* or _italic_italicNo spaces between markers and text
**bold** or __bold__boldNo spaces between markers and text
***bold italic***bold italicCombine them
~~strikethrough~~strikethroughNo spaces between ~~ and text

Bad: ** bold ** — spaces inside markers break it
Good: **bold**

Lists

SyntaxRule
- Item or * ItemSpace required after - or *
1. ItemSpace required after . — number doesn't have to be sequential
- [ ] TaskCheckbox (task list). Space inside brackets: [ ] unchecked, [x] checked

Nested lists: indent 2 or 4 spaces (be consistent). A blank line between items makes "loose" list (extra spacing).

- Parent item
  - Child item (2-space indent)
    - Grandchild (4-space indent from parent)

Links & Images

SyntaxRule
[text](url)No space between ] and (
![alt](image.png)Same as link but with ! prefix
[text](url "title")Optional title in quotes shows on hover

Bad: [text] (url) — space between bracket and paren breaks it

Code

SyntaxRule
`inline code`Single backticks for inline
```python
code here
```
Fenced code block. Language tag is optional. The ``` must be on its own line. No spaces before the closing fence.
(4-space indent)Alternative: indent 4 spaces for a code block (no language highlighting)

Blockquotes

SyntaxRule
> Quote textSpace after > is conventional but not required
> Line 1
> Line 2
Each line needs > for multi-line quotes
> > NestedNest with additional >

Horizontal Rule

--- or *** or ___

Three or more. Must be on its own line. Blank line above recommended (otherwise --- under text becomes a heading).

Tables

| Header 1 | Header 2 |
|----------|----------|
| Cell     | Cell     |
| Cell     | Cell     |

The separator row is required (at least |--|--|).
Alignment: :--| left, :--:| center, |--: right.
Leading/trailing pipes are optional but recommended for readability.
Columns don't need to be aligned in source — VS Code just makes it look nicer.

Line Breaks & Paragraphs

What you wantHow
New paragraphBlank line between text blocks
Line break (soft return)Two spaces at end of line, then Enter. Or <br>
Just pressing Enter onceDoes nothing — text continues on same line in rendered output

This is the #1 gotcha. A single newline in source = no break in output.

The Golden Rules

  1. # needs a space after it — # Yes not #No
  2. - and 1. need a space after them — - Yes not -No
  3. ** and * must touch the text**yes** not ** no **
  4. [text](url)no space between ] and (
  5. Blank line = new paragraph. Single Enter = nothing.
  6. When in doubt, add a blank line before/after block elements (headings, lists, code fences, tables).