Markdown cheatsheet · Lists
Markdown lists: bullets, numbers, nesting
A dash and a space make a bullet. A number, a period and a space make a numbered item. Indentation nests one list inside another.
Bullet lists
-, * and + all work as bullet markers. - is the common choice; whichever you pick, keep it consistent within one list.
- Coffee - Tea - Water
- Coffee
- Tea
- Water
Numbered lists
The numbers you type don't have to be right; renderers renumber automatically. Many people write 1. on every line so reordering items never breaks the sequence.
1. Clone the repo 1. Install dependencies 1. Run the dev server
- Clone the repo
- Install dependencies
- Run the dev server
Nested lists
Indent an item to nest it under the one above. Two spaces are enough for bullets; under a numbered item, indent to align with the text (three spaces), and four spaces is the safe everywhere choice.
- Fruit - Apples - Pears - Vegetables 1. Carrots 2. Leeks
- Fruit
- Apples
- Pears
- Vegetables
- Carrots
- Leeks
More than one line per item
To keep a second paragraph, a quote, or a code block inside a list item, indent it to match the item's text and leave a blank line before it.
1. Install the app. The installer takes a few seconds. 2. Open a folder.
Install the app.
The installer takes a few seconds.
Open a folder.
Common questions
How do I start a numbered list at a specific number?
Start the first item with that number (4.); CommonMark renderers continue from it. Only the first number counts, the rest are renumbered.
Why did my numbered item turn into a heading or code?
A line like 1986. What a year. becomes a list. Escape the period (1986\.) to keep it as text. And four spaces of indentation before a list marker can turn the line into a code block in older renderers.
Can I make a lettered list (a, b, c)?
Not in standard markdown or GFM: ordered lists are numeric only, and a. renders as a plain paragraph. Two ways around it. Pandoc and a few extended flavors accept a. directly. Everywhere else, where inline HTML is allowed, use <ol type="a"><li>…</li></ol>; type="a", "A", "i" and "I" give lowercase letters, uppercase, and roman numerals. GitHub strips the type attribute, so it falls back to numbers there.
How do I continue a list after some text between items?
A paragraph between two list items normally splits them into two lists, restarting the numbering. To keep one list, indent the in-between text to line up under the item content, so the renderer reads it as part of the list rather than a break.