Markdown Coach

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 early

You get

  1. Pack the bag

    Check the zips twice.

  2. 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 early

You get

  1. Pack the bag

    Check the zips twice.

  2. Leave early

A second paragraph inside step 1.

You type

1. Install it:

   ```bash
   npm install
   ```
2. Run it

You get

  1. Install it:

    npm install
  2. Run 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 early

Shows as

  1. 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 it

Shows as

  1. Install it:

npm install
  1. Run 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.

Practise this in the course