SGML

Markdown Block Quote Examples

blockquote0 blockquote1
Basic block quote example
blockquote2 blockquote3 blockquote4 blockquote5 blockquote7 blockquote8 blockquote9
Nested block quotes with variations in indentation
blockquote20 blockquote21
Nested block quote variant
blockquote30 blockquote31 blockquote32 blockquote31
Comprehensive block quote nesting example with details of sgmljs.net SGML's vs markdown.pl's and pandoc's behaviour
blockquoted-header0 blockquoted-header1
Headers in block quotes
blockquoted-list0
Lists in block quotes
blockquote6 blockquote12 over-indented-codeblock-in-blockquote0
Code blocks in block quotes (cf. eg. blockquote7)
blockquote-in-codeblock0
Block quotes in code blocks
Note: To produce HTML from the example markdown sources, copy and paste an example source, store it into a file with the ".md" file extension, and invoke
sgmlproc <your-file.md>
where <your-file.md> is replaced by the actual file used for storing.

blockquote0

This demonstrates a basic block quote
> beginning at the current indentation level

Pandoc won't format it as block quote, needing
a blank line before by default.

Rendered HTML

<p>This demonstrates a basic block quote
</p><blockquote><p>beginning at the current indentation level
</p></blockquote><p>Pandoc won't format it as block quote, needing
a blank line before by default.
</p>

blockquote1

This demonstrates a basic block quote

> beginning at the current indentation level

that is also recognized by Pandoc by default.

Rendered HTML

<p>This demonstrates a basic block quote
</p><blockquote><p>beginning at the current indentation level
</p></blockquote><p>that is also recognized by Pandoc by default.
</p>

blockquote2

This is a test for

>>nested
>blockquotes

markdown.pl/pandoc treat the 2nd line as continuation to
the nested block quote starting in the 1st line and will
discard the `>` prefix on it.

Rendered HTML

<p>This is a test for
</p><blockquote><blockquote><p>nested
blockquotes
</p></blockquote></blockquote><p>markdown.pl/pandoc treat the 2nd line as continuation to
the nested block quote starting in the 1st line and will
discard the <code>&#62;</code> prefix on it.
</p>

blockquote3

This

>  > tests nested
> block quotes

which use blockquoting chars with two spaces.

Rendered HTML

<p>This
</p><blockquote><blockquote><p>tests nested
block quotes
</p></blockquote></blockquote><p>which use blockquoting chars with two spaces.
</p>

blockquote4

This

>   > tests nested
> block quotes

which use blockquoting chars with three spaces.

Rendered HTML

<p>This
</p><blockquote><blockquote><p>tests nested
block quotes
</p></blockquote></blockquote><p>which use blockquoting chars with three spaces.
</p>

blockquote5

This

>    > tests nested
> block quotes

which use blockquoting chars with a quadspace.

Rendered HTML

<p>This
</p><blockquote><blockquote><p>tests nested
block quotes
</p></blockquote></blockquote><p>which use blockquoting chars with a quadspace.
</p>

blockquote7

This

>	> tests nested
> block quotes

which use blockquoting chars with a tab.

Rendered HTML

<p>This
</p><blockquote><blockquote><p>tests nested
block quotes
</p></blockquote></blockquote><p>which use blockquoting chars with a tab.
</p>

blockquote8

This

> 	> tests nested
> block quotes

which use blockquoting chars with a space followed by a tab.

Rendered HTML

<p>This
</p><blockquote><blockquote><p>tests nested
block quotes
</p></blockquote></blockquote><p>which use blockquoting chars with a space followed by a tab.
</p>

blockquote9

This

>  	> tests nested
> block quotes

which use blockquoting chars with two spaces followed by a tab.

Rendered HTML

<p>This
</p><blockquote><blockquote><p>tests nested
block quotes
</p></blockquote></blockquote><p>which use blockquoting chars with two spaces followed by a tab.
</p>

blockquote20

This is a test for

> a blockquote starting at top-level
> > and continuing at a nested level

(in contrast to blockquote1-13, which start at
a nested level and continue with top-level).
Note that pandoc needs the `--strict` option
to render the nested block quote (without it, pandoc
will render the nested block quote as continuation
line).

Rendered HTML

<p>This is a test for
</p><blockquote><p>a blockquote starting at top-level
</p><blockquote><p>and continuing at a nested level
</p></blockquote></blockquote><p>(in contrast to blockquote1-13, which start at
a nested level and continue with top-level).
Note that pandoc needs the <code>--strict</code> option
to render the nested block quote (without it, pandoc
will render the nested block quote as continuation
line).
</p>

blockquote21

This is a test for

> a blockquote starting at top-level
>
> > and continuing at a nested level

where there's a blank line in the quoted block
which is required for pandoc in default mode
so that the line containing "and continuing ..."
isn't regarded as continuation line.

Rendered HTML

<p>This is a test for
</p><blockquote><p>a blockquote starting at top-level
</p><blockquote><p>and continuing at a nested level
</p></blockquote></blockquote><p>where there's a blank line in the quoted block
which is required for pandoc in default mode
so that the line containing "and continuing ..."
isn't regarded as continuation line.
</p>

blockquote30

This is a test for

> a blockquote starting at top-level
> > then opening a nested level
> > further continuing at the nested level
> > > then opening a doubly-nested level
> > > further continuing at the doubly-nested level
> > >
> > then returning to the simply-nested level
> >
> then returning to the top-level blockquote.

markdown.pl doesn't close a blockquote before
"then returning to the simply-nested level"; it
does close a blockquote level before
"then returning to the top-level blockquote",
and closes two blockquote levels after the
blockquote section.

Compare this to blockquote31.txt, where blank lines
are part of the blockquote being returned to,
rather than being closed as here. 

NOTE:
markdown.awk doesn't treat this as markdown.pl does:
markdown.awk doesn't differentiate between whether a
blank line occurs in the blockquote being closed or
in the blockquote being returned to, so formats this
same as blockquote31.txt (which shows the recommended,
portable way to exit from a nested blockquote).

The reason is that markdown.pl's behaviour isn't
documented, and seems merely an implementation
artifact.

Rendered HTML

<p>This is a test for
</p><blockquote><p>a blockquote starting at top-level
</p><blockquote><p>then opening a nested level
further continuing at the nested level
</p><blockquote><p>then opening a doubly-nested level
further continuing at the doubly-nested level
</p></blockquote><p>then returning to the simply-nested level
</p></blockquote><p>then returning to the top-level blockquote.
</p></blockquote><p>markdown.pl doesn't close a blockquote before
"then returning to the simply-nested level"; it
does close a blockquote level before
"then returning to the top-level blockquote",
and closes two blockquote levels after the
blockquote section.
</p><p>Compare this to blockquote31.txt, where blank lines
are part of the blockquote being returned to,
rather than being closed as here. 
</p><p>NOTE:
markdown.awk doesn't treat this as markdown.pl does:
markdown.awk doesn't differentiate between whether a
blank line occurs in the blockquote being closed or
in the blockquote being returned to, so formats this
same as blockquote31.txt (which shows the recommended,
portable way to exit from a nested blockquote).
</p><p>The reason is that markdown.pl's behaviour isn't
documented, and seems merely an implementation
artifact.
</p>

blockquote31

This is a test for

> a blockquote starting at top-level
> > then opening a nested level
> > further continuing at the nested level
> > > then opening a doubly-nested level
> > > further continuing at the doubly-nested level
> >
> > then returning to the simply-nested level
>
> then returning to the top-level blockquote.

markdown.pl needs the blank lines as shown or wouldn't
return to the simply-nested (level 2) nesting level at
"then returning to the simply-nested level" nor to
the level 1 blockquote at "then returning to the
top-level blockquote" (cf. blockquote30.txt).

Rendered HTML

<p>This is a test for
</p><blockquote><p>a blockquote starting at top-level
</p><blockquote><p>then opening a nested level
further continuing at the nested level
</p><blockquote><p>then opening a doubly-nested level
further continuing at the doubly-nested level
</p></blockquote><p>then returning to the simply-nested level
</p></blockquote><p>then returning to the top-level blockquote.
</p></blockquote><p>markdown.pl needs the blank lines as shown or wouldn't
return to the simply-nested (level 2) nesting level at
"then returning to the simply-nested level" nor to
the level 1 blockquote at "then returning to the
top-level blockquote" (cf. blockquote30.txt).
</p>

blockquote32

This is a test for

> a blockquote starting at top-level
> > then opening a nested level
> > further continuing at the nested level
> > > then opening a doubly-nested level
> > > further continuing at the doubly-nested level
> > then returning to the simply-nested level
> then returning to the top-level blockquote.

Here, all blank lines are omitted. markdown.pl
will open blockquotes as expected, but put
all text starting from "then opening a double-nested
level" until the end of the blockquote section into
the innermost blockquote level text, then close
all blockquotes.

Rendered HTML

<p>This is a test for
</p><blockquote><p>a blockquote starting at top-level
</p><blockquote><p>then opening a nested level
further continuing at the nested level
</p><blockquote><p>then opening a doubly-nested level
further continuing at the doubly-nested level
then returning to the simply-nested level
then returning to the top-level blockquote.
</p></blockquote></blockquote></blockquote><p>Here, all blank lines are omitted. markdown.pl
will open blockquotes as expected, but put
all text starting from "then opening a double-nested
level" until the end of the blockquote section into
the innermost blockquote level text, then close
all blockquotes.
</p>

blockquote31

This is a test for

> a blockquote starting at top-level
> > then opening a nested level
> > further continuing at the nested level
> > > then opening a doubly-nested level
> > > further continuing at the doubly-nested level
> >
> > then returning to the simply-nested level
>
> then returning to the top-level blockquote.

markdown.pl needs the blank lines as shown or wouldn't
return to the simply-nested (level 2) nesting level at
"then returning to the simply-nested level" nor to
the level 1 blockquote at "then returning to the
top-level blockquote" (cf. blockquote30.txt).

Rendered HTML

<p>This is a test for
</p><blockquote><p>a blockquote starting at top-level
</p><blockquote><p>then opening a nested level
further continuing at the nested level
</p><blockquote><p>then opening a doubly-nested level
further continuing at the doubly-nested level
</p></blockquote><p>then returning to the simply-nested level
</p></blockquote><p>then returning to the top-level blockquote.
</p></blockquote><p>markdown.pl needs the blank lines as shown or wouldn't
return to the simply-nested (level 2) nesting level at
"then returning to the simply-nested level" nor to
the level 1 blockquote at "then returning to the
top-level blockquote" (cf. blockquote30.txt).
</p>

blockquoted-header0

> # This is a header #
> in a block quote.

Should render as expected.

Rendered HTML

<blockquote><h1 id="this-is-a-header">This is a header
</h1><p>in a block quote.
</p></blockquote><p>Should render as expected.
</p>

blockquoted-header1

>  # This is a header #
>  in a block quote with two space chars between the blockquote char and text.

Should render as expected.

Rendered HTML

<blockquote><p> # This is a header #
 in a block quote with two space chars between the blockquote char and text.
</p></blockquote><p>Should render as expected.
</p>

blockquoted-list0

The following blockquote contains a list.

> This is
>
> - said list
> - within a block quote.

Rendered HTML

<p>The following blockquote contains a list.
</p><blockquote><p>This is
</p><ul><li>said list
</li><li>within a block quote.
</li></ul></blockquote>

blockquote6

This

>     > tests nested
> block quotes

which use blockquoting chars with five spaces.
What looks like a nested blockquote will be rendered as a code block.

Rendered HTML

<p>This
</p><blockquote><pre><code>&#62; tests nested
</code></pre><p>block quotes
</p></blockquote><p>which use blockquoting chars with five spaces.
What looks like a nested blockquote will be rendered as a code block.
</p>

blockquote12

This

>	 > tests nested
> block quotes

which use blockquoting chars with a tab, followed by a single space char

Rendered HTML

<p>This
</p><blockquote><blockquote><p>tests nested
block quotes
</p></blockquote></blockquote><p>which use blockquoting chars with a tab, followed by a single space char
</p>

over-indented-codeblock-in-blockquote0

This

>   		> tests nested
> block quotes

which use blockquoting chars with three spaces followed by two tabs.
(cf blockquote10.txt)

Rendered HTML

<p>This
</p><blockquote><pre><code>	&#62; tests nested
</code></pre><p>block quotes
</p></blockquote><p>which use blockquoting chars with three spaces followed by two tabs.
(cf blockquote10.txt)
</p>

blockquote-in-codeblock0

The following is a markup block demonstrating block quotes in markdown

		Block-quoted text following:

		> > Nested Block-quoted text
		>
		> Block-quoted text

Rendered HTML

<p>The following is a markup block demonstrating block quotes in markdown
</p><pre><code>	Block-quoted text following:

	&#62; &#62; Nested Block-quoted text
	&#62;
	&#62; Block-quoted text
</code></pre>