{{($page.frontmatter.start = 206) ? null : null}}
A block quote marker consists of 0-3 spaces of initial indent, plus (a) the character >
together with a following space, or (b) a single character >
not followed by a space.
The following rules define block quotes:
- Basic case. If a string of lines Ls constitute a sequence of blocks Bs, then the result of prepending a block quote marker to the beginning of each line in Ls is a block quote containing Bs.
- Laziness. If a string of lines Ls constitute a block quote with contents Bs, then the result of deleting the initial block quote marker from one or more lines in which the next non-whitespace character after the block quote marker is paragraph continuation text is a block quote with Bs as its content. Paragraph continuation text is text that will be parsed as part of the content of a paragraph, but does not occur at the beginning of the paragraph.
- Consecutiveness. A document cannot contain two block quotes in a row unless there is a blank linebetween them.
Nothing else counts as a block quote.
Here is a simple example:
The spaces after the >
characters can be omitted:
The >
characters can be indented 1-3 spaces:
Four spaces gives us a code block:
The Laziness clause allows us to omit the >
before paragraph continuation text:
A block quote can contain some lazy and some non-lazy continuation lines:
Laziness only applies to lines that would have been continuations of paragraphs had they been prepended with block quote markers. For example, the >
cannot be omitted in the second line of
> foo
> ---
without changing the meaning:
Similarly, if we omit the >
in the second line of
> - foo
> - bar
then the block quote ends after the first line:
For the same reason, we can’t omit the >
in front of subsequent lines of an indented or fenced code block:
Note that in the following case, we have a lazy continuation line:
To see why, note that in
> foo
> - bar
the - bar
is indented too far to start a list, and can’t be an indented code block because indented code blocks cannot interrupt paragraphs, so it is paragraph continuation text.
A block quote can be empty:
A block quote can have initial or final blank lines:
A blank line always separates block quotes:
(Most current Markdown implementations, including John Gruber’s original Markdown.pl
, will parse this example as a single block quote with two paragraphs. But it seems better to allow the author to decide whether two block quotes or one are wanted.)
Consecutiveness means that if we put these block quotes together, we get a single block quote:
To get a block quote with two paragraphs, use:
Block quotes can interrupt paragraphs:
In general, blank lines are not needed before or after block quotes:
However, because of laziness, a blank line is needed between a block quote and a following paragraph:
It is a consequence of the Laziness rule that any number of initial >
s may be omitted on a continuation line of a nested block quote:
When including an indented code block in a block quote, remember that the block quote marker includes both the >
and a following space. So five spaces are needed after the >
: