Line breaks
Markdown can’t break line automatically in paragraph. The break line is a break tag < br />
in HTML. If you want to break line in paragraph, you need to end a line with two or more spaces
, then type return.
Heads
Markdown supports two styles for heads, one style is Setext, another is atx.
- Setext style headers are “underlined” using equal signs
=
(forfirst-level-headers
) and using dashed signs-
(forsecond-level-headers
).
1 | This is an H1 |
- Atx style headers use 1 to 6 hash characters
#
at the start of the line, corresponding to header levels 1-6.
1 | # This is an H1 |
Blockquotes
Just put a >
symbol before each line, like this:
1 | > This is a blockquote line |
You can put the symbol >
before the first line of a hard-wrapped paragraph.
And also blockquotes can be nested (i.e. a blackquote-in-a-blackquote) by adding additional levels of the symbol >
1 | > This is first level blockquote |
Blockquotes can contains other Markdown elements, including header, list, and codeblocks.
1 | > # This is an H1 |
Lists
Markdown supports ordered (numbered) and unordered (bulleted) lists.
- Unordered lists use asterisks
*
, pluses+
, hyphens-
before each list line.
1 | * item1 |
- Ordered list user numbers followed by each line:
1 | 1. item1 |
Note:
If you want a ordered list, you need use ordinal numbers in you ordered Markdown lists, and start 1 at first item.
Code blocks
Pre-formatted code blocks are used fro programming or other markup source code, rather than forming normal paragraph.
Its’ very simple to produce code blocks, just indent every line of block at least 4 spaces or 1 tab.
This codeblock use 1 tab to generate
Horizontal rules
The horizontal rule tag < hr /> is used to divide up and down content. and you can place at least three asterisks *
, hyphens -
, or underscores _
on a line by themselves.
-----
*****
_____