Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to write multi-line lists in Markdown

Perhaps you're writing an ordered list in markdown and you need to add a list item or two with multiple lines. You try to write it, but your numbers keep resetting! What gives?

What you need to do is add a space after each additional line in a list item.

Quick example

1. Item number one

 Second line in item number one.

2. Item number two!

Results in...

  1. Item number one

Second line in item number one.

  1. Item number two!

Writing multi-line lists with code snippets, blockquotes, and other elements

The same rules apply for these elements. In all cases, you would add a space before each line of the block element. View the raw source of this document to see what I mean.

Full Example

  1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean mi magna, sagittis sit amet tortor sit amet, euismod porttitor velit. Donec eget finibus metus.

Aenean tincidunt ante tempor arcu semper, ut euismod magna maximus. Mauris scelerisque urna et lorem imperdiet viverra. Nam egestas libero quis venenatis fermentum. Suspendisse sit amet consectetur enim, at posuere tortor.

Note: Cras faucibus nisl a lacinia porttitor!

var lorem = ipsum(dolor, sit, amet);
  1. Curabitur sit amet tortor a sem ultricies pretium sed eget neque. Duis non vehicula arcu, ac pulvinar enim. Pellentesque at ex ac purus imperdiet elementum. Maecenas condimentum diam at diam consectetur lacinia.

Vivamus fringilla pellentesque tellus, fermentum venenatis est ornare a. Fusce ullamcorper orci sed porta cursus. Integer tincidunt facilisis orci a semper.

  1. urabitur fringilla accumsan nibh, non volutpat mauris commodo id. In commodo quam eu purus tempor, eget pretium purus gravida.

This comment has been minimized.

Copy link

commented Aug 27, 2018

I do have the exactly same question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.