## Definition lists

Based on https://github.com/jgm/commonmark-hs/blob/e3747fd282c806cd2f8e83226e85f1b83ee889c3/commonmark-extensions/test/definition_lists.md

The term is given on a line by itself, followed by
one or more definitions. Each definition must begin
with `:` (after 0-2 spaces); subsequent lines must
be indented unless they are lazy paragraph
continuations.

Commonmark-HS allows definition lists to use `~`.
We can't do that, because we already use `~` for strikethrough.

The list is tight if there is no blank line between
the term and the first definition, otherwise loose.

```````````````````````````````` example
apple
:   red fruit

orange
:   orange fruit
.
<dl>
<dt>apple</dt>
<dd>red fruit</dd>
<dt>orange</dt>
<dd>orange fruit</dd>
</dl>
````````````````````````````````

Loose:

```````````````````````````````` example
apple

:   red fruit

orange

:   orange fruit
.
<dl>
<dt>apple</dt>
<dd>
<p>red fruit</p>
</dd>
<dt>orange</dt>
<dd>
<p>orange fruit</p>
</dd>
</dl>
````````````````````````````````

Also loose:

```````````````````````````````` example
apple

:   red fruit
.
<dl>
<dt>apple</dt>
<dd>
<p>red fruit</p>
</dd>
</dl>
````````````````````````````````

Indented marker:

```````````````````````````````` example
apple
  : red fruit

orange
  : orange fruit
.
<dl>
<dt>apple</dt>
<dd>red fruit</dd>
<dt>orange</dt>
<dd>orange fruit</dd>
</dl>
````````````````````````````````

```````````````````````````````` example
apple

 : red fruit

orange

 : orange fruit
.
<dl>
<dt>apple</dt>
<dd>
<p>red fruit</p>
</dd>
<dt>orange</dt>
<dd>
<p>orange fruit</p>
</dd>
</dl>
````````````````````````````````

Multiple blocks in a definition:

```````````````````````````````` example
*apple*

:   red fruit

    contains seeds,
    crisp, pleasant to taste

*orange*

:   orange fruit

        { orange code block }

    > orange block quote
.
<dl>
<dt><em>apple</em></dt>
<dd>
<p>red fruit</p>
<p>contains seeds,
crisp, pleasant to taste</p>
</dd>
<dt><em>orange</em></dt>
<dd>
<p>orange fruit</p>
<pre><code>{ orange code block }
</code></pre>
<blockquote>
<p>orange block quote</p>
</blockquote>
</dd>
</dl>
````````````````````````````````

Nested lists:

```````````````````````````````` example
term

:   1. Para one

       Para two
.
<dl>
<dt>term</dt>
<dd>
<ol>
<li><p>Para one</p>
<p>Para two</p></li>
</ol>
</dd>
</dl>
````````````````````````````````

Multiple definitions, tight:

```````````````````````````````` example
apple
:   red fruit
:   computer company

orange
:   orange fruit
:   telecom company
.
<dl>
<dt>apple</dt>
<dd>red fruit</dd>
<dd>computer company</dd>
<dt>orange</dt>
<dd>orange fruit</dd>
<dd>telecom company</dd>
</dl>
````````````````````````````````

Multiple definitions, loose:

```````````````````````````````` example
apple

:   red fruit

:   computer company

orange

:   orange fruit
:   telecom company
.
<dl>
<dt>apple</dt>
<dd>
<p>red fruit</p>
</dd>
<dd>
<p>computer company</p>
</dd>
<dt>orange</dt>
<dd>
<p>orange fruit</p>
</dd>
<dd>
<p>telecom company</p>
</dd>
</dl>
````````````````````````````````

Lazy line continuations:

```````````````````````````````` example
apple

:   red fruit

:   computer
company

orange

:   orange
fruit
:   telecom company
.
<dl>
<dt>apple</dt>
<dd>
<p>red fruit</p>
</dd>
<dd>
<p>computer
company</p>
</dd>
<dt>orange</dt>
<dd>
<p>orange
fruit</p>
</dd>
<dd>
<p>telecom company</p>
</dd>
</dl>
````````````````````````````````

Definition terms may span multiple lines:

```````````````````````````````` example
a
b\
c

:   foo
.
<dl>
<dt>a
b<br />
c</dt>
<dd>
<p>foo</p>
</dd>
</dl>
````````````````````````````````

Definition list with preceding paragraph
(<https://github.com/jgm/commonmark-hs/issues/35>):

```````````````````````````````` example
Foo

bar
:   baz

bim
:   bor
.
<p>Foo</p>
<dl>
<dt>bar</dt>
<dd>baz</dd>
<dt>bim</dt>
<dd>bor</dd>
</dl>
````````````````````````````````

Definition list followed by paragraph.

```````````````````````````````` example
bar
:   baz

bim
:   bor

Bloze
.
<dl>
<dt>bar</dt>
<dd>baz</dd>
<dt>bim</dt>
<dd>bor</dd>
</dl>
<p>Bloze</p>
````````````````````````````````

The total indentation for a definition list cannot exceed four.
This means you can't have one start with four spaces.

```````````````````````````````` example
bar
    :baz

Bloze
.
<p>bar
:baz</p>
<p>Bloze</p>
````````````````````````````````

You can follow one with four spaces,
because it'll "eat" the three spaces after it.

```````````````````````````````` example
bar
:    baz

Bloze
.
<dl>
<dt>bar</dt>
<dd>baz</dd>
</dl>
<p>Bloze</p>
````````````````````````````````

To use an indented code block inside of a definition,
you need to have a total of eight spaces of indentation.
This can be done by having a colon followed by seven spaces,
or three spaces followed by four.

```````````````````````````````` example
bar
:       baz

bar
 :      baz

bar
  :     baz

bar
   :    baz

bar
    :   baz
.
<dl>
<dt>bar</dt>
<dd><pre><code>baz
</code></pre></dd>
<dt>bar</dt>
<dd><pre><code>baz
</code></pre></dd>
<dt>bar</dt>
<dd><pre><code>baz
</code></pre></dd>
<dt>bar</dt>
<dd><pre><code>baz
</code></pre></dd>
</dl>
<p>bar
:   baz</p>
````````````````````````````````


Definition titles can't be tables.

```````````````````````````````` example
Test|Table
----|-----
: first
.
<table><thead><tr><th>Test</th><th>Table</th></tr></thead><tbody></tbody>
</table>
<p>: first</p>
````````````````````````````````

```````````````````````````````` example
first
: second

Test|Table
----|-----
: fourth
.
<dl>
<dt>first</dt>
<dd>second</dd>
</dl>
<table><thead><tr><th>Test</th><th>Table</th></tr></thead><tbody></tbody>
</table>
<p>: fourth</p>
````````````````````````````````


Definition titles can't be headers

```````````````````````````````` example
My section
==========
: first
.
<h1>My section</h1>
<p>: first</p>
````````````````````````````````

```````````````````````````````` example
first
: second

My section
==========
: fourth
.
<dl>
<dt>first</dt>
<dd>second</dd>
</dl>
<h1>My section</h1>
<p>: fourth</p>
````````````````````````````````

```````````````````````````````` example
## My subsection
: first
.
<h2>My subsection</h2>
<p>: first</p>
````````````````````````````````

```````````````````````````````` example
first
: second

## My subsection
: fourth
.
<dl>
<dt>first</dt>
<dd>second</dd>
</dl>
<h2>My subsection</h2>
<p>: fourth</p>
````````````````````````````````


Definition titles can't end with hard line breaks.

```````````````````````````````` example
first\
: second

third  
: fourth
.
<dl>
<dt>first\</dt>
<dd>second</dd>
<dt>third</dt>
<dd>fourth</dd>
</dl>
````````````````````````````````


Definition titles can't be HTML blocks, but inline's fine.

```````````````````````````````` example
<div>first</div>
: second

first
: second
<div>third</div>
: fourth
.
<div>first</div>
: second
<dl>
<dt>first</dt>
<dd>second</dd>
</dl>
<div>third</div>
: fourth
````````````````````````````````

```````````````````````````````` example
<span>first</span>
: second

third
: fourth

<span>fifth</span>
: sixth
.
<dl>
<dt><span>first</span></dt>
<dd>second</dd>
<dt>third</dt>
<dd>fourth</dd>
<dt><span>fifth</span></dt>
<dd>sixth</dd>
</dl>
````````````````````````````````
