"|([ \t]*\n)+( ? ? ?\t| +)[^\n]+(\n|$))*)+" \
)) {
list = substr( block, 1, RLENGTH); block = substr( block, RLENGTH + 1);
- return "\n<dl>\n" _dlist( list ) "</dl>\n" _block( block );
+ return "<dl>\n" _dlist( list ) "</dl>\n" _block( block );
# Unordered list types
} else if ( text = _startlist( block, "ul", "-", "([+*•]|[0-9]+\\.|#\\.|[0-9]+\\)|#\\))") ) {
# '<figure data-src="Test Bild.jpg" class="tv ard function-check"><img src="Test Bild.jpg" alt="Testbild *ARD*" class="tv ard function-check"></figure>' \
# "block image tagged"
+# Headings
+assert 'Heading first Order
+============' \
+'<section class="h1" id="1:Heading%20first%20Order"><h1>Heading first Order<a class="anchor" href="#1:Heading%20first%20Order"></a></h1>
+</section>' \
+'Heading h1'
+
+assert 'Heading first Order {.foo #bar}
+============' \
+'<section class="h1 foo bar" id="1:Heading%20first%20Order"><h1 class="foo bar">Heading first Order<a class="anchor" href="#1:Heading%20first%20Order"></a></h1>
+</section>' \
+'Heading h1 + attributes'
+
+assert 'Heading second Order
+------------' \
+'<section class="h2" id="0.1:Heading%20second%20Order"><h2>Heading second Order<a class="anchor" href="#0.1:Heading%20second%20Order"></a></h2>
+</section>' \
+'Heading h2'
+
+assert 'Heading second Order {.foo #bar}
+------------' \
+'<section class="h2 foo bar" id="0.1:Heading%20second%20Order"><h2 class="foo bar">Heading second Order<a class="anchor" href="#0.1:Heading%20second%20Order"></a></h2>
+</section>' \
+'Heading h2 + attributes'
+
+assert '#### Heading four' \
+'<section class="h4" id="0.0.0.1:Heading%20four"><h4>Heading four<a class="anchor" href="#0.0.0.1:Heading%20four"></a></h4>
+</section>' \
+'Heading arbitrary'
+
+assert '### Heading three ######' \
+'<section class="h3" id="0.0.1:Heading%20three"><h3>Heading three<a class="anchor" href="#0.0.1:Heading%20three"></a></h3>
+</section>' \
+'Heading arbitrary'
+
+assert '### Heading three ## {foo bar}' \
+'<section class="h3 foo bar" id="0.0.1:Heading%20three"><h3 class="foo bar">Heading three<a class="anchor" href="#0.0.1:Heading%20three"></a></h3>
+</section>' \
+'Heading arbitrary + attributes'
+
+assert '# Heading \# # {foo bar}' \
+'<section class="h1 foo bar" id="1:Heading%20%5C%23"><h1 class="foo bar">Heading #<a class="anchor" href="#1:Heading%20%5C%23"></a></h1>
+</section>' \
+'Heading arbitrary + attributes'
+
+assert 'Definition
+: term
+with line continuation
+
+: second term
+
+foo
+: bar' \
+'<dl>
+<dt>Definition</dt>
+<dd>term
+with line continuation</dd>
+<dd>second term</dd>
+<dt>foo</dt>
+<dd>bar</dd>
+</dl>' \
+'Definition List'
+
printf '\nAll test passed!\n'