SGML

Markdown List Examples

list0
Basic list example
list1
List and sublist continuation and termination Note: "However" gets placed in paras by $productname, whereas markdown.pl doesn't do this
list2
Comprehensive list example
list3
Starting a list
listmarker0 listmarker1 listmarker2 listmarker3 listmarker4 listmarker5 listmarker6 listmarker7 listmarker8
List markers
ordered-list0 ordered-list1 ordered-list2 ordered-list3
Ordered (numbered) lists
listitems-in-paras0 listitems-in-paras1 listitems-in-paras4 listitems-in-paras5 listitems-in-paras6 listitems-in-paras7
List item content wrapped in paragraph tags; Note items with span-level markup are wrapped into paragraphs individually, when they probably should be formatted collectively either with or without omitted paragraph wrappers (TODO: see listitems-in-paras2 test case)
list-after-header0 list-after-header1
Starting a list following after a header

list0

-	this is
-	a basic list
	demontrating
	continuation lines
-	without listitems in paragraphs
-	and/or nested lists 

Rendered HTML

<ul><li>this is
</li><li>a basic list
demontrating
continuation lines
</li><li>without listitems in paragraphs
</li><li>and/or nested lists 
</li></ul>

list1

-	A list is continued either
by lazy continuation lines (at indentation level 0)
	or by indenting to one level more
than the list start level

Returning to the list start level after a blank line
terminates a list and continues at the previous indentation level

-	However,
	-	subsequent list or sublist items
-	do not
	-	have to be
	-	separated
-	by a blank line

Rendered HTML

<ul><li>A list is continued either
by lazy continuation lines (at indentation level 0)
or by indenting to one level more
than the list start level
</li></ul><p>Returning to the list start level after a blank line
terminates a list and continues at the previous indentation level
</p><ul><li><p>However,
</p><ul><li>subsequent list or sublist items
</li></ul></li><li><p>do not
</p><ul><li>have to be
</li><li>separated
</li></ul></li><li>by a blank line
</li></ul>

list2

-	this list
	has a 1st list continuation line
	and a 2nd list continuation line
	-	and a sublist
		with 1st sublist continuation line
		and 2nd sublist continuation line
	and a lazy 3rd sublist continuation line
and a lazy 4th sublist continuation line

	and a list continuation line after nested content
	and a general continuation line after that
-	now only need a second list item to cover all list rules

Rendered HTML

<ul><li><p>this list
has a 1st list continuation line
and a 2nd list continuation line
</p><ul><li>and a sublist
with 1st sublist continuation line
and 2nd sublist continuation line
and a lazy 3rd sublist continuation line
and a lazy 4th sublist continuation line
</li></ul><p>and a list continuation line after nested content
and a general continuation line after that
</p></li><li>now only need a second list item to cover all list rules
</li></ul>

list3

From right after a plain (non-list) paragraph
- a list won't start

- it has to be separated by a preceding blank line

Rendered HTML

<p>From right after a plain (non-list) paragraph
- a list won't start
</p><ul><li>it has to be separated by a preceding blank line
</li></ul>

listmarker0

-a list marker is not recognized if it isn't followed space

Rendered HTML

<p>-a list marker is not recognized if it isn't followed space
</p>

listmarker1

- it has to be at least 1 space

Rendered HTML

<ul><li>it has to be at least 1 space
</li></ul>

listmarker2

-  or two spaces

Rendered HTML

<ul><li>or two spaces
</li></ul>

listmarker3

-   or even three two spaces

Rendered HTML

<ul><li>or even three two spaces
</li></ul>

listmarker4

-    indentation within list item text (like here, using 1 quadspace) has no special meaning

Rendered HTML

<ul><li>indentation within list item text (like here, using 1 quadspace) has no special meaning
</li></ul>

listmarker5

-	using tabs between listmarker and list item text also isn't treated special

Rendered HTML

<ul><li>using tabs between listmarker and list item text also isn't treated special
</li></ul>

listmarker6

-		any whitespace after the listmarker is trimmed (whitexpace-normalized)

Rendered HTML

<ul><li>any whitespace after the listmarker is trimmed (whitexpace-normalized)
</li></ul>

listmarker7

 - a list marker
  - may be indented by
   - up to three spaces
    - but using four spaces (a quadspace) will generate a sublist item

Rendered HTML

<ul><li>a list marker
</li><li>may be indented by
</li><li><p>up to three spaces
</p><ul><li>but using four spaces (a quadspace) will generate a sublist item
</li></ul></li></ul>

listmarker8

 + list item
  * markers
- may also be
   * mixed

Rendered HTML

<ul><li>list item
</li><li>markers
</li><li>may also be
</li><li>mixed
</li></ul>

ordered-list0

1. this is
2. a basic ordered list
	demontrating
	continuation lines
3.	without listitems in paragraphs
4.	and/or nested lists 

Rendered HTML

<ol><li>this is
</li><li>a basic ordered list
demontrating
continuation lines
</li><li>without listitems in paragraphs
</li><li>and/or nested lists 
</li></ol>

ordered-list1

1.	A list is continued either
by lazy continuation lines (at indentation level 0)
	or by indenting to one level more
than the list start level

Returning to the list start level after a blank line
terminates a list and continues at the previous indentation level

1.	However,
	1.	subsequent list or sublist items
2.	do not
	1.	have to be
	2.	separated
3.	by a blank line

Rendered HTML

<ol><li>A list is continued either
by lazy continuation lines (at indentation level 0)
or by indenting to one level more
than the list start level
</li></ol><p>Returning to the list start level after a blank line
terminates a list and continues at the previous indentation level
</p><ol><li><p>However,
</p><ol><li>subsequent list or sublist items
</li></ol></li><li><p>do not
</p><ol><li>have to be
</li><li>separated
</li></ol></li><li>by a blank line
</li></ol>

ordered-list2

1.	this list
	has a 1st list continuation line
	and a 2nd list continuation line
	1.	and a sublist
		with 1st sublist continuation line
		and 2nd sublist continuation line
	and a lazy 3rd sublist continuation line
and a lazy 4th sublist continuation line

	and a list continuation line after nested content
	and a general continuation line after that
1.	now only need a second list item to cover all list rules

Rendered HTML

<ol><li><p>this list
has a 1st list continuation line
and a 2nd list continuation line
</p><ol><li>and a sublist
with 1st sublist continuation line
and 2nd sublist continuation line
and a lazy 3rd sublist continuation line
and a lazy 4th sublist continuation line
</li></ol><p>and a list continuation line after nested content
and a general continuation line after that
</p></li><li>now only need a second list item to cover all list rules
</li></ol>

ordered-list3

From right after a plain (non-list) paragraph
10. a list won't start

11. it has to be separated by a preceding blank line

Rendered HTML

<p>From right after a plain (non-list) paragraph
10. a list won't start
</p><ol><li>it has to be separated by a preceding blank line
</li></ol>

listitems-in-paras0

- This demonstrates
- that list items don't get
- their own para tags
- when there's no element content in the items
- and the item lines aren't separated from
  preceding items by blank lines.
- This holds whether a list item is
  multi-line
  or not

Rendered HTML

<ul><li>This demonstrates
</li><li>that list items don't get
</li><li>their own para tags
</li><li>when there's no element content in the items
</li><li>and the item lines aren't separated from
  preceding items by blank lines.
</li><li>This holds whether a list item is
  multi-line
  or not
</li></ul>

listitems-in-paras1

- This demonstrates

- that list items do get their own para tags

- if the item line is separated from preceding items with a blank line

- or there is element content in the item
	- (such as this one)
- But only the items having
  these properties are formatted that way
- other items in the same list don't
  automatically get wrapped into p's

Rendered HTML

<ul><li><p>This demonstrates
</p></li><li><p>that list items do get their own para tags
</p></li><li><p>if the item line is separated from preceding items with a blank line
</p></li><li><p>or there is element content in the item
</p><ul><li>(such as this one)
</li></ul></li><li>But only the items having
  these properties are formatted that way
</li><li>other items in the same list don't
  automatically get wrapped into p's
</li></ul>

listitems-in-paras4

-	Now the question is what effect does a

		code block with a terminating blank line

-	have on subsequent list items.
-	Will those be wrapped into own paragraphs?
-	Yes, they will

Rendered HTML

<ul><li><p>Now the question is what effect does a
</p><pre><code>code block with a terminating blank line
</code></pre></li><li><p>have on subsequent list items.
</p></li><li>Will those be wrapped into own paragraphs?
</li><li>Yes, they will
</li></ul>

listitems-in-paras5

-	And does a

		code block without a terminating blank line
-	have the same effect on subsequent list items.
-	Will those be rendered into own paragraphs?
-	No they won't

Rendered HTML

<ul><li><p>And does a
</p><pre><code>code block without a terminating blank line
</code></pre></li><li>have the same effect on subsequent list items.
</li><li>Will those be rendered into own paragraphs?
</li><li>No they won't
</li></ul>

listitems-in-paras6

-	Furthermore, how does

<pre><code>an HTML code block behave with respect to putting</code></pre>

-	subsequent list item text in paragraphs?
-	An HTML code block terminates any block level element. The above started
	list is ended by the HTML code block end, and a new list is started
	after the block.
-	The block is put into paragraph markers.

Rendered HTML

<ul><li>Furthermore, how does
</li></ul><pre><code>an HTML code block behave with respect to putting</code></pre>
<ul><li>subsequent list item text in paragraphs?
</li><li>An HTML code block terminates any block level element. The above started
list is ended by the HTML code block end, and a new list is started
after the block.
</li><li>The block is put into paragraph markers.
</li></ul>

listitems-in-paras7

-	Furthermore, how does

<span>a span-level HTML code block behave with respect to putting</span>

-	subsequent list item text
-	in paragraphs?
-	It behaves the same as block-level HTML block.

Rendered HTML

<ul><li>Furthermore, how does
</li></ul><span>a span-level HTML code block behave with respect to putting</span>
<ul><li>subsequent list item text
</li><li>in paragraphs?
</li><li>It behaves the same as block-level HTML block.
</li></ul>

list-after-header0

# This is a header #
- and this starts a list
- which shouldn't render as plain paragraph

Rendered HTML

<h1 id="this-is-a-header">This is a header
</h1><ul><li>and this starts a list
</li><li>which shouldn't render as plain paragraph
</li></ul>

list-after-header1

# This is a header #
1. and this starts a numbered list
2. which shouldn't render as plain paragraph

Rendered HTML

<h1 id="this-is-a-header">This is a header
</h1><ol><li>and this starts a numbered list
</li><li>which shouldn't render as plain paragraph
</li></ol>