Markdown: Paragraphs and Code Blocks Inside List Items
A list item can hold more than one line: a second paragraph, a code block or a quote. Leave a blank line, then indent it so it lines up with the item text: two spaces under "- ", three under "1. ".
The rule
To put a second paragraph (or a code block) inside a list item, leave a blank line, then indent it so it lines up with the item text: two spaces under "- ", three under "1. ".
You type
1. Pack the bag
Check the zips twice.
2. Leave earlyYou get
Pack the bag
Check the zips twice.
Leave early
Try it yourself
Make a bullet list: Hat, with a second paragraph Keep it on in the sun. inside it, then Water.
Live preview
More examples
You type
1. Pack the bag
Check the zips twice.
2. Leave earlyYou get
Pack the bag
Check the zips twice.
Leave early
A second paragraph inside step 1.
You type
1. Install it:
```bash
npm install
```
2. Run itYou get
Install it:
npm installRun it
A code block inside a step: indent the fences and the code.
Common mistakes
You type
1. Pack the bag
Check the zips twice.
2. Leave earlyShows as
Pack the bag
Check the zips twice. 2. Leave early
Not indented, so the paragraph breaks the list and numbering restarts.
You type
1. Install it:
```bash
npm install
```
2. Run itShows as
Install it:
npm installRun it
The code block is not indented, so it ends the list.
Where it works
Everywhere. It is how README install steps keep their commands inside the numbered list.
Keep it, not just learn it
The full course has 22 skills on five islands, short Missions that check your answers, and reviews a few days later so it sticks. Free, no sign-up.