This page shows different variations of Markdown lists.
Unordered lists
This list uses asterisks and is preceded by a blank line:
- Red
- Green
- Blue
This list uses pluses and is preceded by a blank line:
- Red
- Green
- Blue
This list uses dashes and is preceded by a blank line:
- Red
- Green
- Blue
Multi-level unordered lists
This list uses asterisks and is preceded by a blank line:
- This is a first-level marker.
- This is a second-level marker and is preceded by four spaces.
- This is a third-level marker and is preceded by five spaces.
- This is a second-level marker and is preceded by four spaces.
Ordered lists
This list numbers every item with 1.
:
- This item is numbered
1.
and is rendered as1.
- This item is also numbered
1.
but is rendered as2.
- This item is also numbered
1.
but is rendered as3.
This list uses ordinal numbers, which is allowed but not recommended:
- This item is numbered
1.
and is rendered as1.
- This item is numbered
2.
and is rendered as2.
- This item is numbered
3.
and is rendered as3.
This list uses non-sequential numbering, which is allowed but not recommended:
- This item is numbered
1.
and is rendered as1.
- This item is numbered
8.
but is rendered as2.
- This item is numbered
2.
but is rendered as3.
Multi-level ordered lists
- This item is numbered
1.
and is rendered as1.
- This item is also numbered
1.
but is rendered asa.
since it is preceded by four spaces. - This item is also numbered
1.
but is rendered asb.
since it is also preceded by four spaces.
- This item is also numbered
- This item is numbered
1.
but is rendered as2.
- This item is also numbered
1.
but is rendered asa.
since it is preceded by four spaces.
- This item is also numbered
Definition lists
- This is a term.
- This is a definition.
This is another definition. Each definition is preceded by a colon (
:
) on a new line. If it consists of more than one line, the additional lines must be indented.This is an inline element of a definition, and it is indented by two spaces.
Elements within list items
Multiple paragraphs
This is an ordered list with multiple paragraphs:
This is a list item with two paragraphs.
The first line of this paragraph is indented by three spaces so that it aligns with the list item. The following lines in this paragraph are indented for readability, though it isn't a requirement.
This is the second list item.
This is an unordered list with multiple paragraphs:
This is a list item with two paragraphs.
The first line of this paragraph is indented by two spaces. The following lines in this paragraph are not indented in the Markdown source, though they are rendered the same as the ordered list above.
This is the second list item with two paragraphs.
All of the lines in this paragraph are indented by two spaces in the Markdown source so that they align with the list item. This is recommended for readability, though it is isn't a requirement.
Blockquotes
A list item with a blockquote:
This is a blockquote inside a list item.
Code blocks
A list item with an indented code block:
public static void main(String[] args) { System.out.println("Hello World"); }
A list item with a fenced code block:
public static void main(String[] args) { System.out.println("Hello World"); }
This paragraph separates the following code block from the list above:
public static void main(String[] args) {
System.out.println("Hello World");
}
Accidental lists
A number directly followed by a period and a space at the beginning of a line is interpreted as a list item.
- What a great season.
Add a backslash before the period to escape it:
1986. What a great season.