Generate and test common_mark tests using unit files Print verbose details when tests fail
diff --git a/pkgs/markdown/pubspec.yaml b/pkgs/markdown/pubspec.yaml index 362145c..b0181a5 100644 --- a/pkgs/markdown/pubspec.yaml +++ b/pkgs/markdown/pubspec.yaml
@@ -22,6 +22,7 @@ collection: ^1.2.0 expected_output: ^1.2.1 html: '>=0.12.2 <0.15.0' + io: ^0.3.2+1 js: ^0.6.1 path: ^1.3.1 pedantic: ^1.3.0
diff --git a/pkgs/markdown/test/common_mark/atx_headings.unit b/pkgs/markdown/test/common_mark/atx_headings.unit new file mode 100644 index 0000000..7813d9d --- /dev/null +++ b/pkgs/markdown/test/common_mark/atx_headings.unit
@@ -0,0 +1,112 @@ +>>> ATX headings - 32 +# foo +## foo +### foo +#### foo +##### foo +###### foo +<<< +<h1>foo</h1> +<h2>foo</h2> +<h3>foo</h3> +<h4>foo</h4> +<h5>foo</h5> +<h6>foo</h6> +>>> ATX headings - 33 +####### foo +<<< +<p>####### foo</p> +>>> ATX headings - 34 +#5 bolt + +#hashtag +<<< +<p>#5 bolt</p> +<p>#hashtag</p> +>>> ATX headings - 35 +\## foo +<<< +<p>## foo</p> +>>> ATX headings - 36 +# foo *bar* \*baz\* +<<< +<h1>foo <em>bar</em> *baz*</h1> +>>> ATX headings - 37 +# foo +<<< +<h1>foo</h1> +>>> ATX headings - 38 + ### foo + ## foo + # foo +<<< +<h3>foo</h3> +<h2>foo</h2> +<h1>foo</h1> +>>> ATX headings - 39 + # foo +<<< +<pre><code># foo +</code></pre> +>>> ATX headings - 40 +foo + # bar +<<< +<p>foo + # bar</p> +>>> ATX headings - 41 +## foo ## + ### bar ### +<<< +<h2>foo</h2> +<h3>bar</h3> +>>> ATX headings - 42 +# foo ################################## +##### foo ## +<<< +<h1>foo</h1> +<h5>foo</h5> +>>> ATX headings - 43 +### foo ### +<<< +<h3>foo ###</h3> +>>> ATX headings - 44 +### foo ### b +<<< +<h3>foo ### b</h3> +>>> ATX headings - 45 +# foo# +<<< +<h1>foo</h1> +>>> ATX headings - 46 +### foo \### +## foo #\## +# foo \# +<<< +<h3>foo \</h3> +<h2>foo #\</h2> +<h1>foo \</h1> +>>> ATX headings - 47 +**** +## foo +**** +<<< +<hr /> +<h2>foo</h2> +<hr /> +>>> ATX headings - 48 +Foo bar +# baz +Bar foo +<<< +<p>Foo bar</p> +<h1>baz</h1> +<p>Bar foo</p> +>>> ATX headings - 49 +## +# +### ### +<<< +<h2></h2> +<p>#</p> +<h3></h3>
diff --git a/pkgs/markdown/test/common_mark/autolinks.unit b/pkgs/markdown/test/common_mark/autolinks.unit new file mode 100644 index 0000000..bf4aeb9 --- /dev/null +++ b/pkgs/markdown/test/common_mark/autolinks.unit
@@ -0,0 +1,76 @@ +>>> Autolinks - 565 +<http://foo.bar.baz> +<<< +<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p> +>>> Autolinks - 566 +<http://foo.bar.baz/test?q=hello&id=22&boolean> +<<< +<p><a href="http://foo.bar.baz/test?q=hello&id=22&boolean">http://foo.bar.baz/test?q=hello&id=22&boolean</a></p> +>>> Autolinks - 567 +<irc://foo.bar:2233/baz> +<<< +<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p> +>>> Autolinks - 568 +<MAILTO:FOO@BAR.BAZ> +<<< +<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p> +>>> Autolinks - 569 +<a+b+c:d> +<<< +<p><a href="a+b+c:d">a+b+c:d</a></p> +>>> Autolinks - 570 +<made-up-scheme://foo,bar> +<<< +<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p> +>>> Autolinks - 571 +<http://../> +<<< +<p><a href="http://../">http://../</a></p> +>>> Autolinks - 572 +<localhost:5001/foo> +<<< +<p><a href="localhost:5001/foo">localhost:5001/foo</a></p> +>>> Autolinks - 573 +<http://foo.bar/baz bim> +<<< +<p><http://foo.bar/baz bim></p> +>>> Autolinks - 574 +<http://example.com/\[\> +<<< +<p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p> +>>> Autolinks - 575 +<foo@bar.example.com> +<<< +<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> +>>> Autolinks - 576 +<foo+special@Bar.baz-bar0.com> +<<< +<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p> +>>> Autolinks - 577 +<foo\+@bar.example.com> +<<< +<p><foo+@bar.example.com></p> +>>> Autolinks - 578 +<> +<<< +<p><></p> +>>> Autolinks - 579 +< http://foo.bar > +<<< +<p>< http://foo.bar ></p> +>>> Autolinks - 580 +<m:abc> +<<< +<p><m:abc></p> +>>> Autolinks - 581 +<foo.bar.baz> +<<< +<p><foo.bar.baz></p> +>>> Autolinks - 582 +http://example.com +<<< +<p>http://example.com</p> +>>> Autolinks - 583 +foo@bar.example.com +<<< +<p>foo@bar.example.com</p>
diff --git a/pkgs/markdown/test/common_mark/backslash_escapes.unit b/pkgs/markdown/test/common_mark/backslash_escapes.unit new file mode 100644 index 0000000..5fac119 --- /dev/null +++ b/pkgs/markdown/test/common_mark/backslash_escapes.unit
@@ -0,0 +1,77 @@ +>>> Backslash escapes - 289 +\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ +<<< +<p>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~</p> +>>> Backslash escapes - 290 +\ \A\a\ \3\φ\« +<<< +<p>\ \A\a\ \3\φ\«</p> +>>> Backslash escapes - 291 +\*not emphasized* +\<br/> not a tag +\[not a link](/foo) +\`not code` +1\. not a list +\* not a list +\# not a heading +\[foo]: /url "not a reference" +<<< +<p>*not emphasized* +<br/> not a tag +[not a link](/foo) +`not code` +1. not a list +* not a list +# not a heading +[foo]: /url "not a reference"</p> +>>> Backslash escapes - 292 +\\*emphasis* +<<< +<p>\<em>emphasis</em></p> +>>> Backslash escapes - 293 +foo\ +bar +<<< +<p>foo<br /> +bar</p> +>>> Backslash escapes - 294 +`` \[\` `` +<<< +<p><code>\[\`</code></p> +>>> Backslash escapes - 295 + \[\] +<<< +<pre><code>\[\] +</code></pre> +>>> Backslash escapes - 296 +~~~ +\[\] +~~~ +<<< +<pre><code>\[\] +</code></pre> +>>> Backslash escapes - 297 +<http://example.com?find=\*> +<<< +<p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p> +>>> Backslash escapes - 298 +<a href="/bar\/)"> +<<< +<a href="/bar\/)"> +>>> Backslash escapes - 299 +[foo](/bar\* "ti\*tle") +<<< +<p><a href="/bar*" title="ti*tle">foo</a></p> +>>> Backslash escapes - 300 +[foo] + +[foo]: /bar\* "ti\*tle" +<<< +<p><a href="/bar*" title="ti*tle">foo</a></p> +>>> Backslash escapes - 301 +``` foo\+bar +foo +``` +<<< +<pre><code class="language-foo\+bar">foo +</code></pre>
diff --git a/pkgs/markdown/test/common_mark/blank_lines.unit b/pkgs/markdown/test/common_mark/blank_lines.unit new file mode 100644 index 0000000..78dbe9c --- /dev/null +++ b/pkgs/markdown/test/common_mark/blank_lines.unit
@@ -0,0 +1,12 @@ +>>> Blank lines - 190 + + +aaa + + +# aaa + + +<<< +<p>aaa</p> +<h1>aaa</h1>
diff --git a/pkgs/markdown/test/common_mark/block_quotes.unit b/pkgs/markdown/test/common_mark/block_quotes.unit new file mode 100644 index 0000000..b26fb93 --- /dev/null +++ b/pkgs/markdown/test/common_mark/block_quotes.unit
@@ -0,0 +1,204 @@ +>>> Block quotes - 191 +> # Foo +> bar +> baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 192 +># Foo +>bar +> baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 193 + > # Foo + > bar + > baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 194 + > # Foo + > bar + > baz +<<< +<pre><code>> # Foo +> bar +> baz +</code></pre> +>>> Block quotes - 195 +> # Foo +> bar +baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 196 +> bar +baz +> foo +<<< +<blockquote> +<p>bar +baz +foo</p></blockquote> +>>> Block quotes - 197 +> foo +--- +<<< +<blockquote> +<p>foo</p></blockquote> +<hr /> +>>> Block quotes - 198 +> - foo +- bar +<<< +<blockquote><ul><li>foo</li></ul></blockquote><ul><li>bar</li></ul> +>>> Block quotes - 199 +> foo + bar +<<< +<blockquote> +<pre><code>foo +</code></pre></blockquote> +<pre><code>bar +</code></pre> +>>> Block quotes - 200 +> ``` +foo +``` +<<< +<blockquote> +<pre><code>foo +</code></pre></blockquote> +<pre><code> +</code></pre> +>>> Block quotes - 201 +> foo + - bar +<<< +<blockquote> +<p>foo</p></blockquote> +<pre><code>- bar +</code></pre> +>>> Block quotes - 202 +> +<<< +<blockquote></blockquote> +>>> Block quotes - 203 +> +> +> +<<< +<blockquote></blockquote> +>>> Block quotes - 204 +> +> foo +> +<<< +<blockquote> +<p>foo</p></blockquote> +>>> Block quotes - 205 +> foo + +> bar +<<< +<blockquote> +<p>foo</p></blockquote> +<blockquote> +<p>bar</p></blockquote> +>>> Block quotes - 206 +> foo +> bar +<<< +<blockquote> +<p>foo +bar</p></blockquote> +>>> Block quotes - 207 +> foo +> +> bar +<<< +<blockquote> +<p>foo</p> +<p>bar</p></blockquote> +>>> Block quotes - 208 +foo +> bar +<<< +<p>foo</p> +<blockquote> +<p>bar</p></blockquote> +>>> Block quotes - 209 +> aaa +*** +> bbb +<<< +<blockquote> +<p>aaa</p></blockquote> +<hr /> +<blockquote> +<p>bbb</p></blockquote> +>>> Block quotes - 210 +> bar +baz +<<< +<blockquote> +<p>bar +baz</p></blockquote> +>>> Block quotes - 211 +> bar + +baz +<<< +<blockquote> +<p>bar</p></blockquote> +<p>baz</p> +>>> Block quotes - 212 +> bar +> +baz +<<< +<blockquote> +<p>bar</p> +<p>baz</p></blockquote> +>>> Block quotes - 213 +> > > foo +bar +<<< +<blockquote> +<blockquote> +<blockquote> +<p>foo +bar</p></blockquote></blockquote></blockquote> +>>> Block quotes - 214 +>>> foo +> bar +>>baz +<<< +<blockquote> +<blockquote> +<blockquote> +<p>foo +bar +baz</p></blockquote></blockquote></blockquote> +>>> Block quotes - 215 +> code + +> not code +<<< +<blockquote> +<pre><code>code +</code></pre></blockquote> +<blockquote> +<p> not code</p></blockquote>
diff --git a/pkgs/markdown/test/common_mark/code_spans.unit b/pkgs/markdown/test/common_mark/code_spans.unit new file mode 100644 index 0000000..956071b --- /dev/null +++ b/pkgs/markdown/test/common_mark/code_spans.unit
@@ -0,0 +1,73 @@ +>>> Code spans - 314 +`foo` +<<< +<p><code>foo</code></p> +>>> Code spans - 315 +`` foo ` bar `` +<<< +<p><code>foo ` bar</code></p> +>>> Code spans - 316 +` `` ` +<<< +<p><code>``</code></p> +>>> Code spans - 317 +`` +foo +`` +<<< +<p><code>foo</code></p> +>>> Code spans - 318 +`foo bar + baz` +<<< +<p><code>foo bar + baz</code></p> +>>> Code spans - 319 +`a b` +<<< +<p><code>a b</code></p> +>>> Code spans - 320 +`foo `` bar` +<<< +<p><code>foo `` bar</code></p> +>>> Code spans - 321 +`foo\`bar` +<<< +<p><code>foo\</code>bar`</p> +>>> Code spans - 322 +*foo`*` +<<< +<p>*foo<code>*</code></p> +>>> Code spans - 323 +[not a `link](/foo`) +<<< +<p>[not a <code>link](/foo</code>)</p> +>>> Code spans - 324 +`<a href="`">` +<<< +<p><code><a href="</code>">`</p> +>>> Code spans - 325 +<a href="`">` +<<< +<p><a href="`">`</p> +>>> Code spans - 326 +`<http://foo.bar.`baz>` +<<< +<p><code><http://foo.bar.</code>baz>`</p> +>>> Code spans - 327 +<http://foo.bar.`baz>` +<<< +<p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p> +>>> Code spans - 328 +```foo`` +<<< +<pre><code class="language-foo``"> +</code></pre> +>>> Code spans - 329 +`foo +<<< +<p>`foo</p> +>>> Code spans - 330 +`foo``bar`` +<<< +<p>`foo<code>bar</code></p>
diff --git a/pkgs/markdown/test/common_mark/emphasis_and_strong_emphasis.unit b/pkgs/markdown/test/common_mark/emphasis_and_strong_emphasis.unit new file mode 100644 index 0000000..97f2a3d --- /dev/null +++ b/pkgs/markdown/test/common_mark/emphasis_and_strong_emphasis.unit
@@ -0,0 +1,523 @@ +>>> Emphasis and strong emphasis - 331 +*foo bar* +<<< +<p><em>foo bar</em></p> +>>> Emphasis and strong emphasis - 332 +a * foo bar* +<<< +<p>a * foo bar*</p> +>>> Emphasis and strong emphasis - 333 +a*"foo"* +<<< +<p>a*"foo"*</p> +>>> Emphasis and strong emphasis - 334 +* a * +<<< +<p><em> a </em></p> +>>> Emphasis and strong emphasis - 335 +foo*bar* +<<< +<p>foo<em>bar</em></p> +>>> Emphasis and strong emphasis - 336 +5*6*78 +<<< +<p>5<em>6</em>78</p> +>>> Emphasis and strong emphasis - 337 +_foo bar_ +<<< +<p><em>foo bar</em></p> +>>> Emphasis and strong emphasis - 338 +_ foo bar_ +<<< +<p>_ foo bar_</p> +>>> Emphasis and strong emphasis - 339 +a_"foo"_ +<<< +<p>a_"foo"_</p> +>>> Emphasis and strong emphasis - 340 +foo_bar_ +<<< +<p>foo_bar_</p> +>>> Emphasis and strong emphasis - 341 +5_6_78 +<<< +<p>5_6_78</p> +>>> Emphasis and strong emphasis - 342 +пристаням_стремятся_ +<<< +<p>пристаням_стремятся_</p> +>>> Emphasis and strong emphasis - 343 +aa_"bb"_cc +<<< +<p>aa_"bb"_cc</p> +>>> Emphasis and strong emphasis - 344 +foo-_(bar)_ +<<< +<p>foo-<em>(bar)</em></p> +>>> Emphasis and strong emphasis - 345 +_foo* +<<< +<p>_foo*</p> +>>> Emphasis and strong emphasis - 346 +*foo bar * +<<< +<p>*foo bar *</p> +>>> Emphasis and strong emphasis - 347 +*foo bar +* +<<< +<p>*foo bar</p><ul><li></li></ul> +>>> Emphasis and strong emphasis - 348 +*(*foo) +<<< +<p>*(*foo)</p> +>>> Emphasis and strong emphasis - 349 +*(*foo*)* +<<< +<p><em>(<em>foo</em>)</em></p> +>>> Emphasis and strong emphasis - 350 +*foo*bar +<<< +<p><em>foo</em>bar</p> +>>> Emphasis and strong emphasis - 351 +_foo bar _ +<<< +<p>_foo bar _</p> +>>> Emphasis and strong emphasis - 352 +_(_foo) +<<< +<p>_(_foo)</p> +>>> Emphasis and strong emphasis - 353 +_(_foo_)_ +<<< +<p><em>(<em>foo</em>)</em></p> +>>> Emphasis and strong emphasis - 354 +_foo_bar +<<< +<p>_foo_bar</p> +>>> Emphasis and strong emphasis - 355 +_пристаням_стремятся +<<< +<p>_пристаням_стремятся</p> +>>> Emphasis and strong emphasis - 356 +_foo_bar_baz_ +<<< +<p><em>foo_bar_baz</em></p> +>>> Emphasis and strong emphasis - 357 +_(bar)_. +<<< +<p><em>(bar)</em>.</p> +>>> Emphasis and strong emphasis - 358 +**foo bar** +<<< +<p><strong>foo bar</strong></p> +>>> Emphasis and strong emphasis - 359 +** foo bar** +<<< +<p>** foo bar**</p> +>>> Emphasis and strong emphasis - 360 +a**"foo"** +<<< +<p>a**"foo"**</p> +>>> Emphasis and strong emphasis - 361 +foo**bar** +<<< +<p>foo<strong>bar</strong></p> +>>> Emphasis and strong emphasis - 362 +__foo bar__ +<<< +<p><strong>foo bar</strong></p> +>>> Emphasis and strong emphasis - 363 +__ foo bar__ +<<< +<p>__ foo bar__</p> +>>> Emphasis and strong emphasis - 364 +__ +foo bar__ +<<< +<p>__ +foo bar__</p> +>>> Emphasis and strong emphasis - 365 +a__"foo"__ +<<< +<p>a__"foo"__</p> +>>> Emphasis and strong emphasis - 366 +foo__bar__ +<<< +<p>foo__bar__</p> +>>> Emphasis and strong emphasis - 367 +5__6__78 +<<< +<p>5__6__78</p> +>>> Emphasis and strong emphasis - 368 +пристаням__стремятся__ +<<< +<p>пристаням__стремятся__</p> +>>> Emphasis and strong emphasis - 369 +__foo, __bar__, baz__ +<<< +<p><strong>foo, <strong>bar</strong>, baz</strong></p> +>>> Emphasis and strong emphasis - 370 +foo-__(bar)__ +<<< +<p>foo-<strong>(bar)</strong></p> +>>> Emphasis and strong emphasis - 371 +**foo bar ** +<<< +<p>**foo bar **</p> +>>> Emphasis and strong emphasis - 372 +**(**foo) +<<< +<p>**(**foo)</p> +>>> Emphasis and strong emphasis - 373 +*(**foo**)* +<<< +<p><em>(<strong>foo</strong>)</em></p> +>>> Emphasis and strong emphasis - 374 +**Gomphocarpus (*Gomphocarpus physocarpus*, syn. +*Asclepias physocarpa*)** +<<< +<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn. +<em>Asclepias physocarpa</em>)</strong></p> +>>> Emphasis and strong emphasis - 375 +**foo "*bar*" foo** +<<< +<p><strong>foo "<em>bar</em>" foo</strong></p> +>>> Emphasis and strong emphasis - 376 +**foo**bar +<<< +<p><strong>foo</strong>bar</p> +>>> Emphasis and strong emphasis - 377 +__foo bar __ +<<< +<p>__foo bar __</p> +>>> Emphasis and strong emphasis - 378 +__(__foo) +<<< +<p>__(__foo)</p> +>>> Emphasis and strong emphasis - 379 +_(__foo__)_ +<<< +<p><em>(<strong>foo</strong>)</em></p> +>>> Emphasis and strong emphasis - 380 +__foo__bar +<<< +<p>__foo__bar</p> +>>> Emphasis and strong emphasis - 381 +__пристаням__стремятся +<<< +<p>__пристаням__стремятся</p> +>>> Emphasis and strong emphasis - 382 +__foo__bar__baz__ +<<< +<p><strong>foo__bar__baz</strong></p> +>>> Emphasis and strong emphasis - 383 +__(bar)__. +<<< +<p><strong>(bar)</strong>.</p> +>>> Emphasis and strong emphasis - 384 +*foo [bar](/url)* +<<< +<p><em>foo <a href="/url">bar</a></em></p> +>>> Emphasis and strong emphasis - 385 +*foo +bar* +<<< +<p><em>foo +bar</em></p> +>>> Emphasis and strong emphasis - 386 +_foo __bar__ baz_ +<<< +<p><em>foo <strong>bar</strong> baz</em></p> +>>> Emphasis and strong emphasis - 387 +_foo _bar_ baz_ +<<< +<p><em>foo <em>bar</em> baz</em></p> +>>> Emphasis and strong emphasis - 388 +__foo_ bar_ +<<< +<p><em><em>foo</em> bar</em></p> +>>> Emphasis and strong emphasis - 389 +*foo *bar** +<<< +<p><em>foo <em>bar</em></em></p> +>>> Emphasis and strong emphasis - 390 +*foo **bar** baz* +<<< +<p><em>foo <strong>bar</strong> baz</em></p> +>>> Emphasis and strong emphasis - 391 +*foo**bar**baz* +<<< +<p><em>foo<strong>bar</strong>baz</em></p> +>>> Emphasis and strong emphasis - 392 +***foo** bar* +<<< +<p><em><strong>foo</strong> bar</em></p> +>>> Emphasis and strong emphasis - 393 +*foo **bar*** +<<< +<p><em>foo <strong>bar</strong></em></p> +>>> Emphasis and strong emphasis - 394 +*foo**bar*** +<<< +<p><em>foo<strong>bar</strong></em></p> +>>> Emphasis and strong emphasis - 395 +*foo **bar *baz* bim** bop* +<<< +<p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p> +>>> Emphasis and strong emphasis - 396 +*foo [*bar*](/url)* +<<< +<p><em>foo <a href="/url"><em>bar</em></a></em></p> +>>> Emphasis and strong emphasis - 397 +** is not an empty emphasis +<<< +<p>** is not an empty emphasis</p> +>>> Emphasis and strong emphasis - 398 +**** is not an empty strong emphasis +<<< +<p>**** is not an empty strong emphasis</p> +>>> Emphasis and strong emphasis - 399 +**foo [bar](/url)** +<<< +<p><strong>foo <a href="/url">bar</a></strong></p> +>>> Emphasis and strong emphasis - 400 +**foo +bar** +<<< +<p><strong>foo +bar</strong></p> +>>> Emphasis and strong emphasis - 401 +__foo _bar_ baz__ +<<< +<p><strong>foo <em>bar</em> baz</strong></p> +>>> Emphasis and strong emphasis - 402 +__foo __bar__ baz__ +<<< +<p><strong>foo <strong>bar</strong> baz</strong></p> +>>> Emphasis and strong emphasis - 403 +____foo__ bar__ +<<< +<p><strong><strong>foo</strong> bar</strong></p> +>>> Emphasis and strong emphasis - 404 +**foo **bar**** +<<< +<p><strong>foo <strong>bar</strong></strong></p> +>>> Emphasis and strong emphasis - 405 +**foo *bar* baz** +<<< +<p><strong>foo <em>bar</em> baz</strong></p> +>>> Emphasis and strong emphasis - 406 +**foo*bar*baz** +<<< +<p><strong>foo<em>bar</em>baz</strong></p> +>>> Emphasis and strong emphasis - 407 +***foo* bar** +<<< +<p><strong><em>foo</em> bar</strong></p> +>>> Emphasis and strong emphasis - 408 +**foo *bar*** +<<< +<p><strong>foo <em>bar</em></strong></p> +>>> Emphasis and strong emphasis - 409 +**foo *bar **baz** +bim* bop** +<<< +<p><strong>foo <em>bar <strong>baz</strong> +bim</em> bop</strong></p> +>>> Emphasis and strong emphasis - 410 +**foo [*bar*](/url)** +<<< +<p><strong>foo <a href="/url"><em>bar</em></a></strong></p> +>>> Emphasis and strong emphasis - 411 +__ is not an empty emphasis +<<< +<p>__ is not an empty emphasis</p> +>>> Emphasis and strong emphasis - 412 +____ is not an empty strong emphasis +<<< +<p>____ is not an empty strong emphasis</p> +>>> Emphasis and strong emphasis - 413 +foo *** +<<< +<p>foo ***</p> +>>> Emphasis and strong emphasis - 414 +foo *\** +<<< +<p>foo <em>*</em></p> +>>> Emphasis and strong emphasis - 415 +foo *_* +<<< +<p>foo <em>_</em></p> +>>> Emphasis and strong emphasis - 416 +foo ***** +<<< +<p>foo *****</p> +>>> Emphasis and strong emphasis - 417 +foo **\*** +<<< +<p>foo <strong>*</strong></p> +>>> Emphasis and strong emphasis - 418 +foo **_** +<<< +<p>foo <strong>_</strong></p> +>>> Emphasis and strong emphasis - 419 +**foo* +<<< +<p>*<em>foo</em></p> +>>> Emphasis and strong emphasis - 420 +*foo** +<<< +<p><em>foo</em>*</p> +>>> Emphasis and strong emphasis - 421 +***foo** +<<< +<p>*<strong>foo</strong></p> +>>> Emphasis and strong emphasis - 422 +****foo* +<<< +<p>***<em>foo</em></p> +>>> Emphasis and strong emphasis - 423 +**foo*** +<<< +<p><strong>foo</strong>*</p> +>>> Emphasis and strong emphasis - 424 +*foo**** +<<< +<p><em>foo</em>***</p> +>>> Emphasis and strong emphasis - 425 +foo ___ +<<< +<p>foo ___</p> +>>> Emphasis and strong emphasis - 426 +foo _\__ +<<< +<p>foo <em>_</em></p> +>>> Emphasis and strong emphasis - 427 +foo _*_ +<<< +<p>foo <em>*</em></p> +>>> Emphasis and strong emphasis - 428 +foo _____ +<<< +<p>foo _____</p> +>>> Emphasis and strong emphasis - 429 +foo __\___ +<<< +<p>foo <strong>_</strong></p> +>>> Emphasis and strong emphasis - 430 +foo __*__ +<<< +<p>foo <strong>*</strong></p> +>>> Emphasis and strong emphasis - 431 +__foo_ +<<< +<p>_<em>foo</em></p> +>>> Emphasis and strong emphasis - 432 +_foo__ +<<< +<p><em>foo</em>_</p> +>>> Emphasis and strong emphasis - 433 +___foo__ +<<< +<p>_<strong>foo</strong></p> +>>> Emphasis and strong emphasis - 434 +____foo_ +<<< +<p>___<em>foo</em></p> +>>> Emphasis and strong emphasis - 435 +__foo___ +<<< +<p><strong>foo</strong>_</p> +>>> Emphasis and strong emphasis - 436 +_foo____ +<<< +<p><em>foo</em>___</p> +>>> Emphasis and strong emphasis - 437 +**foo** +<<< +<p><strong>foo</strong></p> +>>> Emphasis and strong emphasis - 438 +*_foo_* +<<< +<p><em><em>foo</em></em></p> +>>> Emphasis and strong emphasis - 439 +__foo__ +<<< +<p><strong>foo</strong></p> +>>> Emphasis and strong emphasis - 440 +_*foo*_ +<<< +<p><em><em>foo</em></em></p> +>>> Emphasis and strong emphasis - 441 +****foo**** +<<< +<p><strong><strong>foo</strong></strong></p> +>>> Emphasis and strong emphasis - 442 +____foo____ +<<< +<p><strong><strong>foo</strong></strong></p> +>>> Emphasis and strong emphasis - 443 +******foo****** +<<< +<p><strong><strong><strong>foo</strong></strong></strong></p> +>>> Emphasis and strong emphasis - 444 +***foo*** +<<< +<p><em><strong>foo</strong></em></p> +>>> Emphasis and strong emphasis - 445 +_____foo_____ +<<< +<p><em><strong><strong>foo</strong></strong></em></p> +>>> Emphasis and strong emphasis - 446 +*foo _bar* baz_ +<<< +<p><em>foo _bar</em> baz_</p> +>>> Emphasis and strong emphasis - 447 +*foo __bar *baz bim__ bam* +<<< +<p><em>foo <strong>bar *baz bim</strong> bam</em></p> +>>> Emphasis and strong emphasis - 448 +**foo **bar baz** +<<< +<p>**foo <strong>bar baz</strong></p> +>>> Emphasis and strong emphasis - 449 +*foo *bar baz* +<<< +<p>*foo <em>bar baz</em></p> +>>> Emphasis and strong emphasis - 450 +*[bar*](/url) +<<< +<p><em>[bar</em>](/url)</p> +>>> Emphasis and strong emphasis - 451 +_foo [bar_](/url) +<<< +<p><em>foo [bar</em>](/url)</p> +>>> Emphasis and strong emphasis - 452 +*<img src="foo" title="*"/> +<<< +<p>*<img src="foo" title="*"/></p> +>>> Emphasis and strong emphasis - 453 +**<a href="**"> +<<< +<p>**<a href="**"></p> +>>> Emphasis and strong emphasis - 454 +__<a href="__"> +<<< +<p>__<a href="__"></p> +>>> Emphasis and strong emphasis - 455 +*a `*`* +<<< +<p><em>a <code>*</code></em></p> +>>> Emphasis and strong emphasis - 456 +_a `_`_ +<<< +<p><em>a <code>_</code></em></p> +>>> Emphasis and strong emphasis - 457 +**a<http://foo.bar/?q=**> +<<< +<p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p> +>>> Emphasis and strong emphasis - 458 +__a<http://foo.bar/?q=__> +<<< +<p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p>
diff --git a/pkgs/markdown/test/common_mark/entity_and_numeric_character_references.unit b/pkgs/markdown/test/common_mark/entity_and_numeric_character_references.unit new file mode 100644 index 0000000..d2b0011 --- /dev/null +++ b/pkgs/markdown/test/common_mark/entity_and_numeric_character_references.unit
@@ -0,0 +1,60 @@ +>>> Entity and numeric character references - 302 + & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸ +<<< +<p> & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸</p> +>>> Entity and numeric character references - 303 +# Ӓ Ϡ � � +<<< +<p># Ӓ Ϡ � �</p> +>>> Entity and numeric character references - 304 +" ആ ಫ +<<< +<p>" ആ ಫ</p> +>>> Entity and numeric character references - 305 +  &x; &#; &#x; +&ThisIsNotDefined; &hi?; +<<< +<p>&nbsp &x; &#; &#x; +&ThisIsNotDefined; &hi?;</p> +>>> Entity and numeric character references - 306 +© +<<< +<p>&copy</p> +>>> Entity and numeric character references - 307 +&MadeUpEntity; +<<< +<p>&MadeUpEntity;</p> +>>> Entity and numeric character references - 308 +<a href="öö.html"> +<<< +<a href="öö.html"> +>>> Entity and numeric character references - 309 +[foo](/föö "föö") +<<< +<p><a href="/föö" title="föö">foo</a></p> +>>> Entity and numeric character references - 310 +[foo] + +[foo]: /föö "föö" +<<< +<p><a href="/föö" title="föö">foo</a></p> +>>> Entity and numeric character references - 311 +``` föö +foo +``` +<<< +<pre><code class="language-f&ouml;&ouml;">foo +</code></pre> +>>> Entity and numeric character references - 312 +`föö` +<<< +<p><code>f&ouml;&ouml;</code></p> +>>> Entity and numeric character references - 313 + föfö +<<< +<pre><code>f&ouml;f&ouml; +</code></pre>
diff --git a/pkgs/markdown/test/common_mark/fenced_code_blocks.unit b/pkgs/markdown/test/common_mark/fenced_code_blocks.unit new file mode 100644 index 0000000..a414fd8 --- /dev/null +++ b/pkgs/markdown/test/common_mark/fenced_code_blocks.unit
@@ -0,0 +1,244 @@ +>>> Fenced code blocks - 88 +``` +< + > +``` +<<< +<pre><code>< + > +</code></pre> +>>> Fenced code blocks - 89 +~~~ +< + > +~~~ +<<< +<pre><code>< + > +</code></pre> +>>> Fenced code blocks - 90 +`` +foo +`` +<<< +<p><code>foo</code></p> +>>> Fenced code blocks - 91 +``` +aaa +~~~ +``` +<<< +<pre><code>aaa +~~~ +</code></pre> +>>> Fenced code blocks - 92 +~~~ +aaa +``` +~~~ +<<< +<pre><code>aaa +``` +</code></pre> +>>> Fenced code blocks - 93 +```` +aaa +``` +`````` +<<< +<pre><code>aaa +``` +</code></pre> +>>> Fenced code blocks - 94 +~~~~ +aaa +~~~ +~~~~ +<<< +<pre><code>aaa +~~~ +</code></pre> +>>> Fenced code blocks - 95 +``` +<<< +<pre><code> +</code></pre> +>>> Fenced code blocks - 96 +````` + +``` +aaa +<<< +<pre><code> +``` +aaa + +</code></pre> +>>> Fenced code blocks - 97 +> ``` +> aaa + +bbb +<<< +<blockquote> +<pre><code>aaa +</code></pre></blockquote> +<p>bbb</p> +>>> Fenced code blocks - 98 +``` + + +``` +<<< +<pre><code> + +</code></pre> +>>> Fenced code blocks - 99 +``` +``` +<<< +<pre><code></code></pre> +>>> Fenced code blocks - 100 + ``` + aaa +aaa +``` +<<< +<pre><code> aaa +aaa +</code></pre> +>>> Fenced code blocks - 101 + ``` +aaa + aaa +aaa + ``` +<<< +<pre><code>aaa + aaa +aaa +</code></pre> +>>> Fenced code blocks - 102 + ``` + aaa + aaa + aaa + ``` +<<< +<pre><code> aaa + aaa + aaa +</code></pre> +>>> Fenced code blocks - 103 + ``` + aaa + ``` +<<< +<pre><code>``` +aaa +``` +</code></pre> +>>> Fenced code blocks - 104 +``` +aaa + ``` +<<< +<pre><code>aaa +</code></pre> +>>> Fenced code blocks - 105 + ``` +aaa + ``` +<<< +<pre><code>aaa +</code></pre> +>>> Fenced code blocks - 106 +``` +aaa + ``` +<<< +<pre><code>aaa + ``` + +</code></pre> +>>> Fenced code blocks - 107 +``` ``` +aaa +<<< +<pre><code class="language-```">aaa + +</code></pre> +>>> Fenced code blocks - 108 +~~~~~~ +aaa +~~~ ~~ +<<< +<pre><code>aaa +~~~ ~~ + +</code></pre> +>>> Fenced code blocks - 109 +foo +``` +bar +``` +baz +<<< +<p>foo</p> +<pre><code>bar +</code></pre> +<p>baz</p> +>>> Fenced code blocks - 110 +foo +--- +~~~ +bar +~~~ +# baz +<<< +<h2>foo</h2> +<pre><code>bar +</code></pre> +<h1>baz</h1> +>>> Fenced code blocks - 111 +```ruby +def foo(x) + return 3 +end +``` +<<< +<pre><code class="language-ruby">def foo(x) + return 3 +end +</code></pre> +>>> Fenced code blocks - 112 +~~~~ ruby startline=3 $%@#$ +def foo(x) + return 3 +end +~~~~~~~ +<<< +<pre><code class="language-ruby">def foo(x) + return 3 +end +</code></pre> +>>> Fenced code blocks - 113 +````; +```` +<<< +<pre><code class="language-;"></code></pre> +>>> Fenced code blocks - 114 +``` aa ``` +foo +<<< +<pre><code class="language-aa">foo + +</code></pre> +>>> Fenced code blocks - 115 +``` +``` aaa +``` +<<< +<pre><code></code></pre> +<pre><code> +</code></pre>
diff --git a/pkgs/markdown/test/common_mark/hard_line_breaks.unit b/pkgs/markdown/test/common_mark/hard_line_breaks.unit new file mode 100644 index 0000000..e5a454e --- /dev/null +++ b/pkgs/markdown/test/common_mark/hard_line_breaks.unit
@@ -0,0 +1,82 @@ +>>> Hard line breaks - 605 +foo +baz +<<< +<p>foo<br /> +baz</p> +>>> Hard line breaks - 606 +foo\ +baz +<<< +<p>foo<br /> +baz</p> +>>> Hard line breaks - 607 +foo +baz +<<< +<p>foo<br /> +baz</p> +>>> Hard line breaks - 608 +foo + bar +<<< +<p>foo<br /> + bar</p> +>>> Hard line breaks - 609 +foo\ + bar +<<< +<p>foo<br /> + bar</p> +>>> Hard line breaks - 610 +*foo +bar* +<<< +<p><em>foo<br /> +bar</em></p> +>>> Hard line breaks - 611 +*foo\ +bar* +<<< +<p><em>foo<br /> +bar</em></p> +>>> Hard line breaks - 612 +`code +span` +<<< +<p><code>code +span</code></p> +>>> Hard line breaks - 613 +`code\ +span` +<<< +<p><code>code\ +span</code></p> +>>> Hard line breaks - 614 +<a href="foo +bar"> +<<< +<p><a href="foo +bar"></p> +>>> Hard line breaks - 615 +<a href="foo\ +bar"> +<<< +<p><a href="foo\ +bar"></p> +>>> Hard line breaks - 616 +foo\ +<<< +<p>foo\</p> +>>> Hard line breaks - 617 +foo +<<< +<p>foo </p> +>>> Hard line breaks - 618 +### foo\ +<<< +<h3>foo\</h3> +>>> Hard line breaks - 619 +### foo +<<< +<h3>foo</h3>
diff --git a/pkgs/markdown/test/common_mark/html_blocks.unit b/pkgs/markdown/test/common_mark/html_blocks.unit new file mode 100644 index 0000000..c316e4b --- /dev/null +++ b/pkgs/markdown/test/common_mark/html_blocks.unit
@@ -0,0 +1,415 @@ +>>> HTML blocks - 116 +<table><tr><td> +<pre> +**Hello**, + +_world_. +</pre> +</td></tr></table> +<<< +<table><tr><td> +<pre> +**Hello**, +<p><em>world</em>. +</pre></p></td></tr></table> +>>> HTML blocks - 117 +<table> + <tr> + <td> + hi + </td> + </tr> +</table> + +okay. +<<< +<table> + <tr> + <td> + hi + </td> + </tr> +</table> +<p>okay.</p> +>>> HTML blocks - 118 + <div> + *hello* + <foo><a> +<<< + <div> + *hello* + <foo><a> +>>> HTML blocks - 119 +</div> +*foo* +<<< +</div> +*foo* +>>> HTML blocks - 120 +<DIV CLASS="foo"> + +*Markdown* + +</DIV> +<<< +<DIV CLASS="foo"> +<p><em>Markdown</em></p></DIV> +>>> HTML blocks - 121 +<div id="foo" + class="bar"> +</div> +<<< +<div id="foo" + class="bar"> +</div> +>>> HTML blocks - 122 +<div id="foo" class="bar + baz"> +</div> +<<< +<div id="foo" class="bar + baz"> +</div> +>>> HTML blocks - 123 +<div> +*foo* + +*bar* +<<< +<div> +*foo* +<p><em>bar</em></p> +>>> HTML blocks - 124 +<div id="foo" +*hi* +<<< +<div id="foo" +*hi* +>>> HTML blocks - 125 +<div class +foo +<<< +<div class +foo +>>> HTML blocks - 126 +<div *???-&&&-<--- +*foo* +<<< +<div *???-&&&-<--- +*foo* +>>> HTML blocks - 127 +<div><a href="bar">*foo*</a></div> +<<< +<div><a href="bar">*foo*</a></div> +>>> HTML blocks - 128 +<table><tr><td> +foo +</td></tr></table> +<<< +<table><tr><td> +foo +</td></tr></table> +>>> HTML blocks - 129 +<div></div> +``` c +int x = 33; +``` +<<< +<div></div> +``` c +int x = 33; +``` +>>> HTML blocks - 130 +<a href="foo"> +*bar* +</a> +<<< +<a href="foo"> +*bar* +</a> +>>> HTML blocks - 131 +<Warning> +*bar* +</Warning> +<<< +<Warning> +*bar* +</Warning> +>>> HTML blocks - 132 +<i class="foo"> +*bar* +</i> +<<< +<i class="foo"> +*bar* +</i> +>>> HTML blocks - 133 +</ins> +*bar* +<<< +</ins> +*bar* +>>> HTML blocks - 134 +<del> +*foo* +</del> +<<< +<del> +*foo* +</del> +>>> HTML blocks - 135 +<del> + +*foo* + +</del> +<<< +<del> +<p><em>foo</em></p></del> +>>> HTML blocks - 136 +<del>*foo*</del> +<<< +<p><del><em>foo</em></del></p> +>>> HTML blocks - 137 +<pre language="haskell"><code> +import Text.HTML.TagSoup + +main :: IO () +main = print $ parseTags tags +</code></pre> +okay +<<< +<pre language="haskell"><code> +import Text.HTML.TagSoup + +main :: IO () +main = print $ parseTags tags +</code></pre> +<p>okay</p> +>>> HTML blocks - 138 +<script type="text/javascript"> +// JavaScript example + +document.getElementById("demo").innerHTML = "Hello JavaScript!"; +</script> +okay +<<< +<script type="text/javascript"> +// JavaScript example + +document.getElementById("demo").innerHTML = "Hello JavaScript!"; +</script> +<p>okay</p> +>>> HTML blocks - 139 +<style + type="text/css"> +h1 {color:red;} + +p {color:blue;} +</style> +okay +<<< +<style + type="text/css"> +h1 {color:red;} + +p {color:blue;} +</style> +<p>okay</p> +>>> HTML blocks - 140 +<style + type="text/css"> + +foo +<<< +<style + type="text/css"> + +foo + +>>> HTML blocks - 141 +> <div> +> foo + +bar +<<< +<blockquote><div> +foo</blockquote> +<p>bar</p> +>>> HTML blocks - 142 +- <div> +- foo +<<< +<ul><li><div></li><li>foo</li></ul> +>>> HTML blocks - 143 +<style>p{color:red;}</style> +*foo* +<<< +<style>p{color:red;}</style> +<p><em>foo</em></p> +>>> HTML blocks - 144 +<!-- foo -->*bar* +*baz* +<<< +<!-- foo -->*bar* +<p><em>baz</em></p> +>>> HTML blocks - 145 +<script> +foo +</script>1. *bar* +<<< +<script> +foo +</script>1. *bar* +>>> HTML blocks - 146 +<!-- Foo + +bar + baz --> +okay +<<< +<!-- Foo + +bar + baz --> +<p>okay</p> +>>> HTML blocks - 147 +<?php + + echo '>'; + +?> +okay +<<< +<?php + + echo '>'; + +?> +<p>okay</p> +>>> HTML blocks - 148 +<!DOCTYPE html> +<<< +<!DOCTYPE html> +>>> HTML blocks - 149 +<![CDATA[ +function matchwo(a,b) +{ + if (a < b && a < 0) then { + return 1; + + } else { + + return 0; + } +} +]]> +okay +<<< +<![CDATA[ +function matchwo(a,b) +{ + if (a < b && a < 0) then { + return 1; + + } else { + + return 0; + } +} +]]> +<p>okay</p> +>>> HTML blocks - 150 + <!-- foo --> + + <!-- foo --> +<<< + <!-- foo --> +<pre><code><!-- foo --> +</code></pre> +>>> HTML blocks - 151 + <div> + + <div> +<<< + <div> +<pre><code><div> +</code></pre> +>>> HTML blocks - 152 +Foo +<div> +bar +</div> +<<< +<p>Foo</p><div> +bar +</div> +>>> HTML blocks - 153 +<div> +bar +</div> +*foo* +<<< +<div> +bar +</div> +*foo* +>>> HTML blocks - 154 +Foo +<a href="bar"> +baz +<<< +<p>Foo +<a href="bar"> +baz</p> +>>> HTML blocks - 155 +<div> + +*Emphasized* text. + +</div> +<<< +<div> +<p><em>Emphasized</em> text.</p></div> +>>> HTML blocks - 156 +<div> +*Emphasized* text. +</div> +<<< +<div> +*Emphasized* text. +</div> +>>> HTML blocks - 157 +<table> + +<tr> + +<td> +Hi +</td> + +</tr> + +</table> +<<< +<table><tr><td> +Hi +</td></tr></table> +>>> HTML blocks - 158 +<table> + + <tr> + + <td> + Hi + </td> + + </tr> + +</table> +<<< +<table> <tr> +<pre><code><td> + Hi +</td> +</code></pre> </tr></table>
diff --git a/pkgs/markdown/test/common_mark/images.unit b/pkgs/markdown/test/common_mark/images.unit new file mode 100644 index 0000000..481335c --- /dev/null +++ b/pkgs/markdown/test/common_mark/images.unit
@@ -0,0 +1,121 @@ +>>> Images - 543 + +<<< +<p><img src="/url" alt="foo" title="title" /></p> +>>> Images - 544 +![foo *bar*] + +[foo *bar*]: train.jpg "train & tracks" +<<< +<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> +>>> Images - 545 +](/url2) +<<< +<p></p> +>>> Images - 546 +](/url2) +<<< +<p><img src="/url2" alt="foo bar" /></p> +>>> Images - 547 +![foo *bar*][] + +[foo *bar*]: train.jpg "train & tracks" +<<< +<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> +>>> Images - 548 +![foo *bar*][foobar] + +[FOOBAR]: train.jpg "train & tracks" +<<< +<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> +>>> Images - 549 + +<<< +<p><img src="train.jpg" alt="foo" /></p> +>>> Images - 550 +My  +<<< +<p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p> +>>> Images - 551 + +<<< +<p><img src="url" alt="foo" /></p> +>>> Images - 552 + +<<< +<p><img src="/url" alt="" /></p> +>>> Images - 553 +![foo][bar] + +[bar]: /url +<<< +<p><img src="/url" alt="foo" /></p> +>>> Images - 554 +![foo][bar] + +[BAR]: /url +<<< +<p><img src="/url" alt="foo" /></p> +>>> Images - 555 +![foo][] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="foo" title="title" /></p> +>>> Images - 556 +![*foo* bar][] + +[*foo* bar]: /url "title" +<<< +<p><img src="/url" alt="foo bar" title="title" /></p> +>>> Images - 557 +![Foo][] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="Foo" title="title" /></p> +>>> Images - 558 +![foo] +[] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="foo" title="title" /> +[]</p> +>>> Images - 559 +![foo] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="foo" title="title" /></p> +>>> Images - 560 +![*foo* bar] + +[*foo* bar]: /url "title" +<<< +<p><img src="/url" alt="foo bar" title="title" /></p> +>>> Images - 561 +![[foo]] + +[[foo]]: /url "title" +<<< +<p>![[foo]]</p> +<p>[[foo]]: /url "title"</p> +>>> Images - 562 +![Foo] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="Foo" title="title" /></p> +>>> Images - 563 +!\[foo] + +[foo]: /url "title" +<<< +<p>![foo]</p> +>>> Images - 564 +\![foo] + +[foo]: /url "title" +<<< +<p>!<a href="/url" title="title">foo</a></p>
diff --git a/pkgs/markdown/test/common_mark/indented_code_blocks.unit b/pkgs/markdown/test/common_mark/indented_code_blocks.unit new file mode 100644 index 0000000..ad4a07a --- /dev/null +++ b/pkgs/markdown/test/common_mark/indented_code_blocks.unit
@@ -0,0 +1,108 @@ +>>> Indented code blocks - 76 + a simple + indented code block +<<< +<pre><code>a simple + indented code block +</code></pre> +>>> Indented code blocks - 77 + - foo + + bar +<<< +<ul><li> +<p>foo</p> +<p>bar</p></li></ul> +>>> Indented code blocks - 78 +1. foo + + - bar +<<< +<ol><li> +<p> foo</p><ul><li>bar</li></ul></li></ol> +>>> Indented code blocks - 79 + <a/> + *hi* + + - one +<<< +<pre><code><a/> +*hi* + +- one +</code></pre> +>>> Indented code blocks - 80 + chunk1 + + chunk2 + + + + chunk3 +<<< +<pre><code>chunk1 + +chunk2 +</code></pre> +<pre><code>chunk3 +</code></pre> +>>> Indented code blocks - 81 + chunk1 + + chunk2 +<<< +<pre><code>chunk1 + + chunk2 +</code></pre> +>>> Indented code blocks - 82 +Foo + bar + +<<< +<p>Foo + bar</p> +>>> Indented code blocks - 83 + foo +bar +<<< +<pre><code>foo +</code></pre> +<p>bar</p> +>>> Indented code blocks - 84 +# Heading + foo +Heading +------ + foo +---- +<<< +<h1>Heading</h1> +<pre><code>foo +</code></pre> +<h2>Heading</h2> +<pre><code>foo +</code></pre> +<hr /> +>>> Indented code blocks - 85 + foo + bar +<<< +<pre><code> foo +bar +</code></pre> +>>> Indented code blocks - 86 + + + foo + + +<<< +<pre><code>foo + +</code></pre> +>>> Indented code blocks - 87 + foo +<<< +<pre><code>foo +</code></pre>
diff --git a/pkgs/markdown/test/common_mark/inlines.unit b/pkgs/markdown/test/common_mark/inlines.unit new file mode 100644 index 0000000..3875d52 --- /dev/null +++ b/pkgs/markdown/test/common_mark/inlines.unit
@@ -0,0 +1,4 @@ +>>> Inlines - 288 +`hi`lo` +<<< +<p><code>hi</code>lo`</p>
diff --git a/pkgs/markdown/test/common_mark/link_reference_definitions.unit b/pkgs/markdown/test/common_mark/link_reference_definitions.unit new file mode 100644 index 0000000..17f87cb --- /dev/null +++ b/pkgs/markdown/test/common_mark/link_reference_definitions.unit
@@ -0,0 +1,173 @@ +>>> Link reference definitions - 159 +[foo]: /url "title" + +[foo] +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Link reference definitions - 160 + [foo]: + /url + 'the title' + +[foo] +<<< +<p><a href="/url" title="the title">foo</a></p> +>>> Link reference definitions - 161 +[Foo*bar\]]:my_(url) 'title (with parens)' + +[Foo*bar\]] +<<< +<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p> +>>> Link reference definitions - 162 +[Foo bar]: +<my%20url> +'title' + +[Foo bar] +<<< +<p><a href="my%20url" title="title">Foo bar</a></p> +>>> Link reference definitions - 163 +[foo]: /url ' +title +line1 +line2 +' + +[foo] +<<< +<p><a href="/url" title=" +title +line1 +line2 +">foo</a></p> +>>> Link reference definitions - 164 +[foo]: /url 'title + +with blank line' + +[foo] +<<< +<p>[foo]: /url 'title</p> +<p>with blank line'</p> +<p>[foo]</p> +>>> Link reference definitions - 165 +[foo]: +/url + +[foo] +<<< +<p><a href="/url">foo</a></p> +>>> Link reference definitions - 166 +[foo]: + +[foo] +<<< +<p>[foo]:</p> +<p>[foo]</p> +>>> Link reference definitions - 167 +[foo]: /url\bar\*baz "foo\"bar\baz" + +[foo] +<<< +<p>[foo]: /url\bar*baz "foo"bar\baz"</p> +<p>[foo]</p> +>>> Link reference definitions - 168 +[foo] + +[foo]: url +<<< +<p><a href="url">foo</a></p> +>>> Link reference definitions - 169 +[foo] + +[foo]: first +[foo]: second +<<< +<p><a href="first">foo</a></p> +>>> Link reference definitions - 170 +[FOO]: /url + +[Foo] +<<< +<p><a href="/url">Foo</a></p> +>>> Link reference definitions - 171 +[ΑΓΩ]: /φου + +[αγω] +<<< +<p><a href="/φου">αγω</a></p> +>>> Link reference definitions - 172 +[foo]: /url +<<< + +>>> Link reference definitions - 173 +[ +foo +]: /url +bar +<<< +<p>bar</p> +>>> Link reference definitions - 174 +[foo]: /url "title" ok +<<< +<p>[foo]: /url "title" ok</p> +>>> Link reference definitions - 175 +[foo]: /url +"title" ok +<<< +<p>"title" ok</p> +>>> Link reference definitions - 176 + [foo]: /url "title" + +[foo] +<<< +<pre><code>[foo]: /url "title" +</code></pre> +<p>[foo]</p> +>>> Link reference definitions - 177 +``` +[foo]: /url +``` + +[foo] +<<< +<pre><code>[foo]: /url +</code></pre> +<p>[foo]</p> +>>> Link reference definitions - 178 +Foo +[bar]: /baz + +[bar] +<<< +<p>Foo +[bar]: /baz</p> +<p>[bar]</p> +>>> Link reference definitions - 179 +# [Foo] +[foo]: /url +> bar +<<< +<h1><a href="/url">Foo</a></h1> +<blockquote> +<p>bar</p></blockquote> +>>> Link reference definitions - 180 +[foo]: /foo-url "foo" +[bar]: /bar-url + "bar" +[baz]: /baz-url + +[foo], +[bar], +[baz] +<<< +<p><a href="/foo-url" title="foo">foo</a>, +<a href="/bar-url" title="bar">bar</a>, +<a href="/baz-url">baz</a></p> +>>> Link reference definitions - 181 +[foo] + +> [foo]: /url +<<< +<p><a href="/url">foo</a></p> +<blockquote></blockquote>
diff --git a/pkgs/markdown/test/common_mark/links.unit b/pkgs/markdown/test/common_mark/links.unit new file mode 100644 index 0000000..045e935 --- /dev/null +++ b/pkgs/markdown/test/common_mark/links.unit
@@ -0,0 +1,459 @@ +>>> Links - 459 +[link](/uri "title") +<<< +<p><a href="/uri" title="title">link</a></p> +>>> Links - 460 +[link](/uri) +<<< +<p><a href="/uri">link</a></p> +>>> Links - 461 +[link]() +<<< +<p><a href="">link</a></p> +>>> Links - 462 +[link](<>) +<<< +<p><a href="">link</a></p> +>>> Links - 463 +[link](/my uri) +<<< +<p>[link](/my uri)</p> +>>> Links - 464 +[link](</my uri>) +<<< +<p>[link](</my uri>)</p> +>>> Links - 465 +[link](foo +bar) +<<< +<p>[link](foo +bar)</p> +>>> Links - 466 +[link](<foo +bar>) +<<< +<p>[link](<foo +bar>)</p> +>>> Links - 467 +[link](\(foo\)) +<<< +<p><a href="(foo)">link</a></p> +>>> Links - 468 +[link](foo(and(bar))) +<<< +<p><a href="foo(and(bar))">link</a></p> +>>> Links - 469 +[link](foo\(and\(bar\)) +<<< +<p><a href="foo(and(bar)">link</a></p> +>>> Links - 470 +[link](<foo(and(bar)>) +<<< +<p><a href="foo(and(bar)">link</a></p> +>>> Links - 471 +[link](foo\)\:) +<<< +<p><a href="foo):">link</a></p> +>>> Links - 472 +[link](#fragment) + +[link](http://example.com#fragment) + +[link](http://example.com?foo=3#frag) +<<< +<p><a href="#fragment">link</a></p> +<p><a href="http://example.com#fragment">link</a></p> +<p><a href="http://example.com?foo=3#frag">link</a></p> +>>> Links - 473 +[link](foo\bar) +<<< +<p><a href="foo%5Cbar">link</a></p> +>>> Links - 474 +[link](foo%20bä) +<<< +<p><a href="foo%20bä">link</a></p> +>>> Links - 475 +[link]("title") +<<< +<p><a href="%22title%22">link</a></p> +>>> Links - 476 +[link](/url "title") +[link](/url 'title') +[link](/url (title)) +<<< +<p><a href="/url" title="title">link</a> +<a href="/url" title="title">link</a> +<a href="/url" title="title">link</a></p> +>>> Links - 477 +[link](/url "title \""") +<<< +<p><a href="/url" title="title %22"">link</a></p> +>>> Links - 478 +[link](/url "title") +<<< +<p><a href="/url %22title%22">link</a></p> +>>> Links - 479 +[link](/url "title "and" title") +<<< +<p>[link](/url "title "and" title")</p> +>>> Links - 480 +[link](/url 'title "and" title') +<<< +<p><a href="/url" title="title %22and%22 title">link</a></p> +>>> Links - 481 +[link]( /uri + "title" ) +<<< +<p><a href="/uri" title="title">link</a></p> +>>> Links - 482 +[link] (/uri) +<<< +<p>[link] (/uri)</p> +>>> Links - 483 +[link [foo [bar]]](/uri) +<<< +<p><a href="/uri">link [foo [bar]]</a></p> +>>> Links - 484 +[link] bar](/uri) +<<< +<p>[link] bar](/uri)</p> +>>> Links - 485 +[link [bar](/uri) +<<< +<p>[link <a href="/uri">bar</a></p> +>>> Links - 486 +[link \[bar](/uri) +<<< +<p><a href="/uri">link [bar</a></p> +>>> Links - 487 +[link *foo **bar** `#`*](/uri) +<<< +<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> +>>> Links - 488 +[](/uri) +<<< +<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> +>>> Links - 489 +[foo [bar](/uri)](/uri) +<<< +<p>[foo <a href="/uri">bar</a>](/uri)</p> +>>> Links - 490 +[foo *[bar [baz](/uri)](/uri)*](/uri) +<<< +<p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p> +>>> Links - 491 +](uri2)](uri3) +<<< +<p><img src="uri3" alt="[foo](uri2)" /></p> +>>> Links - 492 +*[foo*](/uri) +<<< +<p><em>[foo</em>](/uri)</p> +>>> Links - 493 +[foo *bar](baz*) +<<< +<p><a href="baz*">foo *bar</a></p> +>>> Links - 494 +*foo [bar* baz] +<<< +<p><em>foo [bar</em> baz]</p> +>>> Links - 495 +[foo <bar attr="](baz)"> +<<< +<p>[foo <bar attr="](baz)"></p> +>>> Links - 496 +[foo`](/uri)` +<<< +<p>[foo<code>](/uri)</code></p> +>>> Links - 497 +[foo<http://example.com/?search=](uri)> +<<< +<p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p> +>>> Links - 498 +[foo][bar] + +[bar]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 499 +[link [foo [bar]]][ref] + +[ref]: /uri +<<< +<p><a href="/uri">link [foo [bar]]</a></p> +>>> Links - 500 +[link \[bar][ref] + +[ref]: /uri +<<< +<p><a href="/uri">link [bar</a></p> +>>> Links - 501 +[link *foo **bar** `#`*][ref] + +[ref]: /uri +<<< +<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> +>>> Links - 502 +[][ref] + +[ref]: /uri +<<< +<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> +>>> Links - 503 +[foo [bar](/uri)][ref] + +[ref]: /uri +<<< +<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p> +>>> Links - 504 +[foo *bar [baz][ref]*][ref] + +[ref]: /uri +<<< +<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p> +>>> Links - 505 +*[foo*][ref] + +[ref]: /uri +<<< +<p><em>[foo</em>]<a href="/uri">ref</a></p> +>>> Links - 506 +[foo *bar][ref] + +[ref]: /uri +<<< +<p><a href="/uri">foo *bar</a></p> +>>> Links - 507 +[foo <bar attr="][ref]"> + +[ref]: /uri +<<< +<p>[foo <bar attr="][ref]"></p> +>>> Links - 508 +[foo`][ref]` + +[ref]: /uri +<<< +<p>[foo<code>][ref]</code></p> +>>> Links - 509 +[foo<http://example.com/?search=][ref]> + +[ref]: /uri +<<< +<p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p> +>>> Links - 510 +[foo][BaR] + +[bar]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 511 +[Толпой][Толпой] is a Russian word. + +[ТОЛПОЙ]: /url +<<< +<p><a href="/url">Толпой</a> is a Russian word.</p> +>>> Links - 512 +[Foo + bar]: /url + +[Baz][Foo bar] +<<< +<p><a href="/url">Baz</a></p> +>>> Links - 513 +[foo] [bar] + +[bar]: /url "title" +<<< +<p>[foo] <a href="/url" title="title">bar</a></p> +>>> Links - 514 +[foo] +[bar] + +[bar]: /url "title" +<<< +<p>[foo] +<a href="/url" title="title">bar</a></p> +>>> Links - 515 +[foo]: /url1 + +[foo]: /url2 + +[bar][foo] +<<< +<p><a href="/url1">bar</a></p> +>>> Links - 516 +[bar][foo\!] + +[foo!]: /url +<<< +<p>[bar][foo!]</p> +>>> Links - 517 +[foo][ref[] + +[ref[]: /uri +<<< +<p><a href="/uri">foo</a></p> +>>> Links - 518 +[foo][ref[bar]] + +[ref[bar]]: /uri +<<< +<p>[foo][ref[bar]]</p> +<p>[ref[bar]]: /uri</p> +>>> Links - 519 +[[[foo]]] + +[[[foo]]]: /url +<<< +<p>[[[foo]]]</p> +<p>[[[foo]]]: /url</p> +>>> Links - 520 +[foo][ref\[] + +[ref\[]: /uri +<<< +<p><a href="/uri">foo</a></p> +>>> Links - 521 +[bar\\]: /uri + +[bar\\] +<<< +<p><a href="/uri">bar\</a></p> +>>> Links - 522 +[] + +[]: /uri +<<< +<p>[]</p> +<p>[]: /uri</p> +>>> Links - 523 +[ + ] + +[ + ]: /uri +<<< +<p>[ + ]</p> +<p>[ + ]: /uri</p> +>>> Links - 524 +[foo][] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 525 +[*foo* bar][] + +[*foo* bar]: /url "title" +<<< +<p><a href="/url" title="title"><em>foo</em> bar</a></p> +>>> Links - 526 +[Foo][] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">Foo</a></p> +>>> Links - 527 +[foo] +[] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">foo</a> +[]</p> +>>> Links - 528 +[foo] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 529 +[*foo* bar] + +[*foo* bar]: /url "title" +<<< +<p><a href="/url" title="title"><em>foo</em> bar</a></p> +>>> Links - 530 +[[*foo* bar]] + +[*foo* bar]: /url "title" +<<< +<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p> +>>> Links - 531 +[[bar [foo] + +[foo]: /url +<<< +<p>[[bar <a href="/url">foo</a></p> +>>> Links - 532 +[Foo] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">Foo</a></p> +>>> Links - 533 +[foo] bar + +[foo]: /url +<<< +<p><a href="/url">foo</a> bar</p> +>>> Links - 534 +\[foo] + +[foo]: /url "title" +<<< +<p>[foo]</p> +>>> Links - 535 +[foo*]: /url + +*[foo*] +<<< +<p><em>[foo</em>]</p> +>>> Links - 536 +[foo][bar] + +[foo]: /url1 +[bar]: /url2 +<<< +<p><a href="/url2">foo</a></p> +>>> Links - 537 +[foo][] + +[foo]: /url1 +<<< +<p><a href="/url1">foo</a></p> +>>> Links - 538 +[foo]() + +[foo]: /url1 +<<< +<p><a href="">foo</a></p> +>>> Links - 539 +[foo](not a link) + +[foo]: /url1 +<<< +<p><a href="/url1">foo</a>(not a link)</p> +>>> Links - 540 +[foo][bar][baz] + +[baz]: /url +<<< +<p>[foo]<a href="/url">bar</a></p> +>>> Links - 541 +[foo][bar][baz] + +[baz]: /url1 +[bar]: /url2 +<<< +<p><a href="/url2">foo</a><a href="/url1">baz</a></p> +>>> Links - 542 +[foo][bar][baz] + +[baz]: /url1 +[foo]: /url2 +<<< +<p>[foo]<a href="/url1">bar</a></p>
diff --git a/pkgs/markdown/test/common_mark/list_items.unit b/pkgs/markdown/test/common_mark/list_items.unit new file mode 100644 index 0000000..0b17140 --- /dev/null +++ b/pkgs/markdown/test/common_mark/list_items.unit
@@ -0,0 +1,418 @@ +>>> List items - 216 +A paragraph +with two lines. + + indented code + +> A block quote. +<<< +<p>A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote> +>>> List items - 217 +1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 218 +- one + + two +<<< +<ul><li>one</li></ul> +<p> two</p> +>>> List items - 219 +- one + + two +<<< +<ul><li> +<p>one</p> +<p>two</p></li></ul> +>>> List items - 220 + - one + + two +<<< +<ul><li> one</li></ul> +<pre><code> two +</code></pre> +>>> List items - 221 + - one + + two +<<< +<ul><li> +<p> one</p> +<p>two</p></li></ul> +>>> List items - 222 + > > 1. one +>> +>> two +<<< +<blockquote> +<blockquote><ol><li> +<p> one</p> +<p>two</p></li></ol></blockquote></blockquote> +>>> List items - 223 +>>- one +>> + > > two +<<< +<blockquote> +<blockquote><ul><li>one</li></ul> +<p>two</p></blockquote></blockquote> +>>> List items - 224 +-one + +2.two +<<< +<p>-one</p> +<p>2.two</p> +>>> List items - 225 +- foo + + + bar +<<< +<ul><li>foo</li></ul> +<p> bar</p> +>>> List items - 226 +1. foo + + ``` + bar + ``` + + baz + + > bam +<<< +<ol><li> +<p> foo</p> +<pre><code>bar +</code></pre> +<p>baz</p> +<blockquote> +<p>bam</p></blockquote></li></ol> +>>> List items - 227 +- Foo + + bar + + + baz +<<< +<ul><li> +<p>Foo</p> +<pre><code>bar +</code></pre></li></ul> +<pre><code> baz +</code></pre> +>>> List items - 228 +123456789. ok +<<< +<ol start="123456789"><li>ok</li></ol> +>>> List items - 229 +1234567890. not ok +<<< +<p>1234567890. not ok</p> +>>> List items - 230 +0. ok +<<< +<ol start="0"><li>ok</li></ol> +>>> List items - 231 +003. ok +<<< +<ol start="3"><li>ok</li></ol> +>>> List items - 232 +-1. not ok +<<< +<p>-1. not ok</p> +>>> List items - 233 +- foo + + bar +<<< +<ul><li> +<p>foo</p> +<pre><code>bar +</code></pre></li></ul> +>>> List items - 234 + 10. foo + + bar +<<< +<ol start="10"><li> +<p> foo</p> +<pre><code>bar +</code></pre></li></ol> +>>> List items - 235 + indented code + +paragraph + + more code +<<< +<pre><code>indented code +</code></pre> +<p>paragraph</p> +<pre><code>more code +</code></pre> +>>> List items - 236 +1. indented code + + paragraph + + more code +<<< +<ol><li> +<pre><code>indented code +</code></pre> +<p>paragraph</p> +<pre><code>more code +</code></pre></li></ol> +>>> List items - 237 +1. indented code + + paragraph + + more code +<<< +<ol><li> +<pre><code> indented code +</code></pre> +<p>paragraph</p> +<pre><code>more code +</code></pre></li></ol> +>>> List items - 238 + foo + +bar +<<< +<p> foo</p> +<p>bar</p> +>>> List items - 239 +- foo + + bar +<<< +<ul><li> foo</li></ul> +<p> bar</p> +>>> List items - 240 +- foo + + bar +<<< +<ul><li> +<p> foo</p> +<p>bar</p></li></ul> +>>> List items - 241 +- + foo +- + ``` + bar + ``` +- + baz +<<< +<ul><li>foo</li><li> +<pre><code>bar +</code></pre></li><li> +<pre><code>baz +</code></pre></li></ul> +>>> List items - 242 +- + foo +<<< +<ul><li>foo</li></ul> +>>> List items - 243 +- + + foo +<<< +<ul><li> +<p>foo</p></li></ul> +>>> List items - 244 +- foo +- +- bar +<<< +<ul><li>foo</li><li></li><li>bar</li></ul> +>>> List items - 245 +- foo +- +- bar +<<< +<ul><li>foo</li><li></li><li>bar</li></ul> +>>> List items - 246 +1. foo +2. +3. bar +<<< +<ol><li>foo</li><li></li><li>bar</li></ol> +>>> List items - 247 +* +<<< +<ul><li></li></ul> +>>> List items - 248 +foo +* + +foo +1. +<<< +<p>foo</p><ul><li></li></ul> +<p>foo</p><ol><li></li></ol> +>>> List items - 249 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 250 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 251 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 252 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<pre><code>1. A paragraph + with two lines. + + indented code + + > A block quote. +</code></pre> +>>> List items - 253 + 1. A paragraph +with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 254 + 1. A paragraph + with two lines. +<<< +<ol><li> A paragraph + with two lines.</li></ol> +>>> List items - 255 +> 1. > Blockquote +continued here. +<<< +<blockquote><ol><li> +<blockquote> +<p>Blockquote +continued here.</p></blockquote></li></ol></blockquote> +>>> List items - 256 +> 1. > Blockquote +> continued here. +<<< +<blockquote><ol><li> +<blockquote> +<p>Blockquote +continued here.</p></blockquote></li></ol></blockquote> +>>> List items - 257 +- foo + - bar + - baz + - boo +<<< +<ul><li>foo<ul><li>bar<ul><li>baz<ul><li>boo</li></ul></li></ul></li></ul></li></ul> +>>> List items - 258 +- foo + - bar + - baz + - boo +<<< +<ul><li>foo</li><li>bar</li><li>baz</li><li>boo</li></ul> +>>> List items - 259 +10) foo + - bar +<<< +<ol start="10"><li>foo<ul><li>bar</li></ul></li></ol> +>>> List items - 260 +10) foo + - bar +<<< +<ol start="10"><li>foo</li></ol><ul><li>bar</li></ul> +>>> List items - 261 +- - foo +<<< +<ul><li><ul><li>foo</li></ul></li></ul> +>>> List items - 262 +1. - 2. foo +<<< +<ol><li><ul><li><ol start="2"><li>foo</li></ol></li></ul></li></ol> +>>> List items - 263 +- # Foo +- Bar + --- + baz +<<< +<ul><li> +<h1>Foo</h1></li><li> +<h2>Bar</h2>baz</li></ul>
diff --git a/pkgs/markdown/test/common_mark/lists.unit b/pkgs/markdown/test/common_mark/lists.unit new file mode 100644 index 0000000..2417076 --- /dev/null +++ b/pkgs/markdown/test/common_mark/lists.unit
@@ -0,0 +1,232 @@ +>>> Lists - 264 +- foo +- bar ++ baz +<<< +<ul><li>foo</li><li>bar</li></ul><ul><li>baz</li></ul> +>>> Lists - 265 +1. foo +2. bar +3) baz +<<< +<ol><li>foo</li><li>bar</li></ol><ol start="3"><li>baz</li></ol> +>>> Lists - 266 +Foo +- bar +- baz +<<< +<p>Foo</p><ul><li>bar</li><li>baz</li></ul> +>>> Lists - 267 +The number of windows in my house is +14. The number of doors is 6. +<<< +<p>The number of windows in my house is</p><ol start="14"><li> The number of doors is 6.</li></ol> +>>> Lists - 268 +The number of windows in my house is +1. The number of doors is 6. +<<< +<p>The number of windows in my house is</p><ol><li> The number of doors is 6.</li></ol> +>>> Lists - 269 +- foo + +- bar + + +- baz +<<< +<ul><li> +<p>foo</p></li><li> +<p>bar</p></li></ul><ul><li>baz</li></ul> +>>> Lists - 270 +- foo + - bar + - baz + + + bim +<<< +<ul><li>foo<ul><li>bar<ul><li>baz</li></ul></li></ul></li></ul> +<pre><code> bim +</code></pre> +>>> Lists - 271 +- foo +- bar + +<!-- --> + +- baz +- bim +<<< +<ul><li>foo</li><li>bar</li></ul><!-- --><ul><li>baz</li><li>bim</li></ul> +>>> Lists - 272 +- foo + + notcode + +- foo + +<!-- --> + + code +<<< +<ul><li> +<p> foo</p> +<p>notcode</p></li><li> +<p> foo</p></li></ul><!-- --> +<pre><code>code +</code></pre> +>>> Lists - 273 +- a + - b + - c + - d + - e + - f + - g + - h +- i +<<< +<ul><li>a</li><li>b</li><li>c</li><li>d + - e</li><li>f</li><li>g</li><li>h</li><li>i</li></ul> +>>> Lists - 274 +1. a + + 2. b + + 3. c +<<< +<ol><li> +<p>a</p></li><li> +<p>b</p></li></ol> +<pre><code>3. c +</code></pre> +>>> Lists - 275 +- a +- b + +- c +<<< +<ul><li> +<p>a</p></li><li> +<p>b</p></li><li> +<p>c</p></li></ul> +>>> Lists - 276 +* a +* + +* c +<<< +<ul><li> +<p>a</p></li><li></li><li> +<p>c</p></li></ul> +>>> Lists - 277 +- a +- b + + c +- d +<<< +<ul><li> +<p>a</p></li><li> +<p>b</p> +<p>c</p></li><li> +<p>d</p></li></ul> +>>> Lists - 278 +- a +- b + + [ref]: /url +- d +<<< +<ul><li> +<p>a</p></li><li> +<p>b</p></li><li> +<p>d</p></li></ul> +>>> Lists - 279 +- a +- ``` + b + + + ``` +- c +<<< +<ul><li>a</li><li> +<pre><code>b +</code></pre></li></ul> +<pre><code>- c + +</code></pre> +>>> Lists - 280 +- a + - b + + c +- d +<<< +<ul><li>a<ul><li> +<p>b</p> +<p>c</p></li></ul></li><li>d</li></ul> +>>> Lists - 281 +* a + > b + > +* c +<<< +<ul><li>a +<blockquote> +<p>b</p></blockquote></li><li>c</li></ul> +>>> Lists - 282 +- a + > b + ``` + c + ``` +- d +<<< +<ul><li>a +<blockquote> +<p>b</p></blockquote> +<pre><code>c +</code></pre></li><li>d</li></ul> +>>> Lists - 283 +- a +<<< +<ul><li>a</li></ul> +>>> Lists - 284 +- a + - b +<<< +<ul><li>a<ul><li>b</li></ul></li></ul> +>>> Lists - 285 +1. ``` + foo + ``` + + bar +<<< +<ol><li> +<pre><code>foo +</code></pre> +<p>bar</p></li></ol> +>>> Lists - 286 +* foo + * bar + + baz +<<< +<ul><li> +<p>foo</p><ul><li>bar</li></ul> +<p>baz</p></li></ul> +>>> Lists - 287 +- a + - b + - c + +- d + - e + - f +<<< +<ul><li> +<p>a</p><ul><li>b</li><li>c</li></ul></li><li> +<p>d</p><ul><li>e</li><li>f</li></ul></li></ul>
diff --git a/pkgs/markdown/test/common_mark/paragraphs.unit b/pkgs/markdown/test/common_mark/paragraphs.unit new file mode 100644 index 0000000..f91e8e6 --- /dev/null +++ b/pkgs/markdown/test/common_mark/paragraphs.unit
@@ -0,0 +1,59 @@ +>>> Paragraphs - 182 +aaa + +bbb +<<< +<p>aaa</p> +<p>bbb</p> +>>> Paragraphs - 183 +aaa +bbb + +ccc +ddd +<<< +<p>aaa +bbb</p> +<p>ccc +ddd</p> +>>> Paragraphs - 184 +aaa + + +bbb +<<< +<p>aaa</p> +<p>bbb</p> +>>> Paragraphs - 185 + aaa + bbb +<<< +<p> aaa + bbb</p> +>>> Paragraphs - 186 +aaa + bbb + ccc +<<< +<p>aaa + bbb + ccc</p> +>>> Paragraphs - 187 + aaa +bbb +<<< +<p> aaa +bbb</p> +>>> Paragraphs - 188 + aaa +bbb +<<< +<pre><code>aaa +</code></pre> +<p>bbb</p> +>>> Paragraphs - 189 +aaa +bbb +<<< +<p>aaa<br /> +bbb </p>
diff --git a/pkgs/markdown/test/common_mark/precedence.unit b/pkgs/markdown/test/common_mark/precedence.unit new file mode 100644 index 0000000..e91d5c7 --- /dev/null +++ b/pkgs/markdown/test/common_mark/precedence.unit
@@ -0,0 +1,5 @@ +>>> Precedence - 12 +- `one +- two` +<<< +<ul><li>`one</li><li>two`</li></ul>
diff --git a/pkgs/markdown/test/common_mark/raw_html.unit b/pkgs/markdown/test/common_mark/raw_html.unit new file mode 100644 index 0000000..eb21ab4 --- /dev/null +++ b/pkgs/markdown/test/common_mark/raw_html.unit
@@ -0,0 +1,95 @@ +>>> Raw HTML - 584 +<a><bab><c2c> +<<< +<p><a><bab><c2c></p> +>>> Raw HTML - 585 +<a/><b2/> +<<< +<p><a/><b2/></p> +>>> Raw HTML - 586 +<a /><b2 +data="foo" > +<<< +<p><a /><b2 +data="foo" ></p> +>>> Raw HTML - 587 +<a foo="bar" bam = 'baz <em>"</em>' +_boolean zoop:33=zoop:33 /> +<<< +<p><a foo="bar" bam = 'baz <em>"</em>' +_boolean zoop:33=zoop:33 /></p> +>>> Raw HTML - 588 +Foo <responsive-image src="foo.jpg" /> +<<< +<p>Foo <responsive-image src="foo.jpg" /></p> +>>> Raw HTML - 589 +<33> <__> +<<< +<p><33> <__></p> +>>> Raw HTML - 590 +<a h*#ref="hi"> +<<< +<a h*#ref="hi"> +>>> Raw HTML - 591 +<a href="hi'> <a href=hi'> +<<< +<p><a href="hi'> <a href=hi'></p> +>>> Raw HTML - 592 +< a>< +foo><bar/ > +<<< +<p>< a>< +foo><bar/ ></p> +>>> Raw HTML - 593 +<a href='bar'title=title> +<<< +<a href='bar'title=title> +>>> Raw HTML - 594 +</a></foo > +<<< +<p></a></foo ></p> +>>> Raw HTML - 595 +</a href="foo"> +<<< +</a href="foo"> +>>> Raw HTML - 596 +foo <!-- this is a +comment - with hyphen --> +<<< +<p>foo <!-- this is a +comment - with hyphen --></p> +>>> Raw HTML - 597 +foo <!-- not a comment -- two hyphens --> +<<< +<p>foo <!-- not a comment -- two hyphens --></p> +>>> Raw HTML - 598 +foo <!--> foo --> + +foo <!-- foo---> +<<< +<p>foo <!--> foo --></p> +<p>foo <!-- foo---></p> +>>> Raw HTML - 599 +foo <?php echo $a; ?> +<<< +<p>foo <?php echo $a; ?></p> +>>> Raw HTML - 600 +foo <!ELEMENT br EMPTY> +<<< +<p>foo <!ELEMENT br EMPTY></p> +>>> Raw HTML - 601 +foo <![CDATA[>&<]]> +<<< +<p>foo <![CDATA[>&<]]></p> +>>> Raw HTML - 602 +foo <a href="ö"> +<<< +<p>foo <a href="ö"></p> +>>> Raw HTML - 603 +foo <a href="\*"> +<<< +<p>foo <a href="\*"></p> +>>> Raw HTML - 604 +<a href="\""> +<<< +<a href="\"">
diff --git a/pkgs/markdown/test/common_mark/setext_headings.unit b/pkgs/markdown/test/common_mark/setext_headings.unit new file mode 100644 index 0000000..206fc6e --- /dev/null +++ b/pkgs/markdown/test/common_mark/setext_headings.unit
@@ -0,0 +1,214 @@ +>>> Setext headings - 50 +Foo *bar* +========= + +Foo *bar* +--------- +<<< +<h1>Foo <em>bar</em></h1> +<h2>Foo <em>bar</em></h2> +>>> Setext headings - 51 +Foo *bar +baz* +==== +<<< +<h1>Foo <em>bar +baz</em></h1> +>>> Setext headings - 52 +Foo +------------------------- + +Foo += +<<< +<h2>Foo</h2> +<h1>Foo</h1> +>>> Setext headings - 53 + Foo +--- + + Foo +----- + + Foo + === +<<< +<h2> Foo</h2> +<h2> Foo</h2> +<h1> Foo</h1> +>>> Setext headings - 54 + Foo + --- + + Foo +--- +<<< +<pre><code>Foo +--- + +Foo +</code></pre> +<hr /> +>>> Setext headings - 55 +Foo + ---- +<<< +<h2>Foo</h2> +>>> Setext headings - 56 +Foo + --- +<<< +<p>Foo + ---</p> +>>> Setext headings - 57 +Foo += = + +Foo +--- - +<<< +<p>Foo += =</p> +<p>Foo</p> +<hr /> +>>> Setext headings - 58 +Foo +----- +<<< +<h2>Foo </h2> +>>> Setext headings - 59 +Foo\ +---- +<<< +<h2>Foo\</h2> +>>> Setext headings - 60 +`Foo +---- +` + +<a title="a lot +--- +of dashes"/> +<<< +<h2>`Foo</h2> +<p>`</p> +<h2><a title="a lot</h2> +<p>of dashes"/></p> +>>> Setext headings - 61 +> Foo +--- +<<< +<blockquote> +<p>Foo</p></blockquote> +<hr /> +>>> Setext headings - 62 +> foo +bar +=== +<<< +<blockquote> +<p>foo</p></blockquote> +<h1>bar</h1> +>>> Setext headings - 63 +- Foo +--- +<<< +<ul><li>Foo</li></ul> +<hr /> +>>> Setext headings - 64 +Foo +Bar +--- +<<< +<h2>Foo +Bar</h2> +>>> Setext headings - 65 +--- +Foo +--- +Bar +--- +Baz +<<< +<hr /> +<h2>Foo</h2> +<h2>Bar</h2> +<p>Baz</p> +>>> Setext headings - 66 + +==== +<<< +<p>====</p> +>>> Setext headings - 67 +--- +--- +<<< +<hr /> +<hr /> +>>> Setext headings - 68 +- foo +----- +<<< +<ul><li>foo</li></ul> +<hr /> +>>> Setext headings - 69 + foo +--- +<<< +<pre><code>foo +</code></pre> +<hr /> +>>> Setext headings - 70 +> foo +----- +<<< +<blockquote> +<p>foo</p></blockquote> +<hr /> +>>> Setext headings - 71 +\> foo +------ +<<< +<h2>> foo</h2> +>>> Setext headings - 72 +Foo + +bar +--- +baz +<<< +<p>Foo</p> +<h2>bar</h2> +<p>baz</p> +>>> Setext headings - 73 +Foo +bar + +--- + +baz +<<< +<p>Foo +bar</p> +<hr /> +<p>baz</p> +>>> Setext headings - 74 +Foo +bar +* * * +baz +<<< +<p>Foo +bar</p> +<hr /> +<p>baz</p> +>>> Setext headings - 75 +Foo +bar +\--- +baz +<<< +<p>Foo +bar +--- +baz</p>
diff --git a/pkgs/markdown/test/common_mark/soft_line_breaks.unit b/pkgs/markdown/test/common_mark/soft_line_breaks.unit new file mode 100644 index 0000000..ee6efe8 --- /dev/null +++ b/pkgs/markdown/test/common_mark/soft_line_breaks.unit
@@ -0,0 +1,12 @@ +>>> Soft line breaks - 620 +foo +baz +<<< +<p>foo +baz</p> +>>> Soft line breaks - 621 +foo + baz +<<< +<p>foo + baz</p>
diff --git a/pkgs/markdown/test/common_mark/tabs.unit b/pkgs/markdown/test/common_mark/tabs.unit new file mode 100644 index 0000000..97804f6 --- /dev/null +++ b/pkgs/markdown/test/common_mark/tabs.unit
@@ -0,0 +1,67 @@ +>>> Tabs - 1 + foo baz bim +<<< +<pre><code>foo baz bim +</code></pre> +>>> Tabs - 2 + foo baz bim +<<< +<pre><code>foo baz bim +</code></pre> +>>> Tabs - 3 + a a + ὐ a +<<< +<pre><code>a a +ὐ a +</code></pre> +>>> Tabs - 4 + - foo + + bar +<<< +<ul><li> +<p>foo</p> +<p>bar</p></li></ul> +>>> Tabs - 5 +- foo + + bar +<<< +<ul><li> +<p>foo</p> +<pre><code> bar +</code></pre></li></ul> +>>> Tabs - 6 +> foo +<<< +<blockquote> +<pre><code> foo +</code></pre></blockquote> +>>> Tabs - 7 +- foo +<<< +<ul><li> +<pre><code>foo +</code></pre></li></ul> +>>> Tabs - 8 + foo + bar +<<< +<pre><code>foo +bar +</code></pre> +>>> Tabs - 9 + - foo + - bar + - baz +<<< +<ul><li>foo<ul><li>bar<ul><li>baz</li></ul></li></ul></li></ul> +>>> Tabs - 10 +# Foo +<<< +<h1>Foo</h1> +>>> Tabs - 11 +* * * +<<< +<hr />
diff --git a/pkgs/markdown/test/common_mark/textual_content.unit b/pkgs/markdown/test/common_mark/textual_content.unit new file mode 100644 index 0000000..5c64c58 --- /dev/null +++ b/pkgs/markdown/test/common_mark/textual_content.unit
@@ -0,0 +1,12 @@ +>>> Textual content - 622 +hello $.;'there +<<< +<p>hello $.;'there</p> +>>> Textual content - 623 +Foo χρῆν +<<< +<p>Foo χρῆν</p> +>>> Textual content - 624 +Multiple spaces +<<< +<p>Multiple spaces</p>
diff --git a/pkgs/markdown/test/common_mark/thematic_breaks.unit b/pkgs/markdown/test/common_mark/thematic_breaks.unit new file mode 100644 index 0000000..ed9fc50 --- /dev/null +++ b/pkgs/markdown/test/common_mark/thematic_breaks.unit
@@ -0,0 +1,112 @@ +>>> Thematic breaks - 13 +*** +--- +___ +<<< +<hr /> +<hr /> +<hr /> +>>> Thematic breaks - 14 ++++ +<<< +<p>+++</p> +>>> Thematic breaks - 15 +=== +<<< +<p>===</p> +>>> Thematic breaks - 16 +-- +** +__ +<<< +<p>-- +** +__</p> +>>> Thematic breaks - 17 + *** + *** + *** +<<< +<hr /> +<hr /> +<hr /> +>>> Thematic breaks - 18 + *** +<<< +<pre><code>*** +</code></pre> +>>> Thematic breaks - 19 +Foo + *** +<<< +<p>Foo + ***</p> +>>> Thematic breaks - 20 +_____________________________________ +<<< +<hr /> +>>> Thematic breaks - 21 + - - - +<<< +<hr /> +>>> Thematic breaks - 22 + ** * ** * ** * ** +<<< +<hr /> +>>> Thematic breaks - 23 +- - - - +<<< +<hr /> +>>> Thematic breaks - 24 +- - - - +<<< +<hr /> +>>> Thematic breaks - 25 +_ _ _ _ a + +a------ + +---a--- +<<< +<p>_ _ _ _ a</p> +<p>a------</p> +<p>---a---</p> +>>> Thematic breaks - 26 + *-* +<<< +<p> <em>-</em></p> +>>> Thematic breaks - 27 +- foo +*** +- bar +<<< +<ul><li>foo</li></ul> +<hr /><ul><li>bar</li></ul> +>>> Thematic breaks - 28 +Foo +*** +bar +<<< +<p>Foo</p> +<hr /> +<p>bar</p> +>>> Thematic breaks - 29 +Foo +--- +bar +<<< +<h2>Foo</h2> +<p>bar</p> +>>> Thematic breaks - 30 +* Foo +* * * +* Bar +<<< +<ul><li>Foo</li></ul> +<hr /><ul><li>Bar</li></ul> +>>> Thematic breaks - 31 +- Foo +- * * * +<<< +<ul><li>Foo</li><li> +<hr /></li></ul>
diff --git a/pkgs/markdown/test/common_mark_test.dart b/pkgs/markdown/test/common_mark_test.dart deleted file mode 100644 index 1210cf9..0000000 --- a/pkgs/markdown/test/common_mark_test.dart +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:convert'; - -import 'package:test/test.dart'; - -import '../tool/stats_lib.dart'; - -void main() { - _registerTests(Config.commonMarkConfig); - _registerTests(Config.gfmConfig); -} - -void _registerTests(Config config) { - var tests = loadCommonMarkSections(config.prefix); - - var statsFile = getStatsFile(config.prefix); - var statsJson = - jsonDecode(statsFile.readAsStringSync()) as Map<String, dynamic>; - - group(config.prefix, () { - tests.forEach((section, examples) { - group(section, () { - var sectionStats = statsJson[section]; - for (var e in examples) { - test('Example ${e.example}', () { - var expected = sectionStats[e.example.toString()]; - - expect(expected, isNotNull); - - var result = compareResult(config, e, throwOnError: true); - - // not super-pretty way to get the value section of an enum - var resultString = result.toString().split('.')[1]; - expect(resultString, expected); - }); - } - }); - }); - }); -}
diff --git a/pkgs/markdown/test/gfm/atx_headings.unit b/pkgs/markdown/test/gfm/atx_headings.unit new file mode 100644 index 0000000..7813d9d --- /dev/null +++ b/pkgs/markdown/test/gfm/atx_headings.unit
@@ -0,0 +1,112 @@ +>>> ATX headings - 32 +# foo +## foo +### foo +#### foo +##### foo +###### foo +<<< +<h1>foo</h1> +<h2>foo</h2> +<h3>foo</h3> +<h4>foo</h4> +<h5>foo</h5> +<h6>foo</h6> +>>> ATX headings - 33 +####### foo +<<< +<p>####### foo</p> +>>> ATX headings - 34 +#5 bolt + +#hashtag +<<< +<p>#5 bolt</p> +<p>#hashtag</p> +>>> ATX headings - 35 +\## foo +<<< +<p>## foo</p> +>>> ATX headings - 36 +# foo *bar* \*baz\* +<<< +<h1>foo <em>bar</em> *baz*</h1> +>>> ATX headings - 37 +# foo +<<< +<h1>foo</h1> +>>> ATX headings - 38 + ### foo + ## foo + # foo +<<< +<h3>foo</h3> +<h2>foo</h2> +<h1>foo</h1> +>>> ATX headings - 39 + # foo +<<< +<pre><code># foo +</code></pre> +>>> ATX headings - 40 +foo + # bar +<<< +<p>foo + # bar</p> +>>> ATX headings - 41 +## foo ## + ### bar ### +<<< +<h2>foo</h2> +<h3>bar</h3> +>>> ATX headings - 42 +# foo ################################## +##### foo ## +<<< +<h1>foo</h1> +<h5>foo</h5> +>>> ATX headings - 43 +### foo ### +<<< +<h3>foo ###</h3> +>>> ATX headings - 44 +### foo ### b +<<< +<h3>foo ### b</h3> +>>> ATX headings - 45 +# foo# +<<< +<h1>foo</h1> +>>> ATX headings - 46 +### foo \### +## foo #\## +# foo \# +<<< +<h3>foo \</h3> +<h2>foo #\</h2> +<h1>foo \</h1> +>>> ATX headings - 47 +**** +## foo +**** +<<< +<hr /> +<h2>foo</h2> +<hr /> +>>> ATX headings - 48 +Foo bar +# baz +Bar foo +<<< +<p>Foo bar</p> +<h1>baz</h1> +<p>Bar foo</p> +>>> ATX headings - 49 +## +# +### ### +<<< +<h2></h2> +<p>#</p> +<h3></h3>
diff --git a/pkgs/markdown/test/gfm/autolinks.unit b/pkgs/markdown/test/gfm/autolinks.unit new file mode 100644 index 0000000..75ab9b8 --- /dev/null +++ b/pkgs/markdown/test/gfm/autolinks.unit
@@ -0,0 +1,76 @@ +>>> Autolinks - 585 +<http://foo.bar.baz> +<<< +<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p> +>>> Autolinks - 586 +<http://foo.bar.baz/test?q=hello&id=22&boolean> +<<< +<p><a href="http://foo.bar.baz/test?q=hello&id=22&boolean">http://foo.bar.baz/test?q=hello&id=22&boolean</a></p> +>>> Autolinks - 587 +<irc://foo.bar:2233/baz> +<<< +<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p> +>>> Autolinks - 588 +<MAILTO:FOO@BAR.BAZ> +<<< +<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p> +>>> Autolinks - 589 +<a+b+c:d> +<<< +<p><a href="a+b+c:d">a+b+c:d</a></p> +>>> Autolinks - 590 +<made-up-scheme://foo,bar> +<<< +<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p> +>>> Autolinks - 591 +<http://../> +<<< +<p><a href="http://../">http://../</a></p> +>>> Autolinks - 592 +<localhost:5001/foo> +<<< +<p><a href="localhost:5001/foo">localhost:5001/foo</a></p> +>>> Autolinks - 593 +<http://foo.bar/baz bim> +<<< +<p><http://foo.bar/baz bim></p> +>>> Autolinks - 594 +<http://example.com/\[\> +<<< +<p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p> +>>> Autolinks - 595 +<foo@bar.example.com> +<<< +<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> +>>> Autolinks - 596 +<foo+special@Bar.baz-bar0.com> +<<< +<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p> +>>> Autolinks - 597 +<foo\+@bar.example.com> +<<< +<p><foo+@bar.example.com></p> +>>> Autolinks - 598 +<> +<<< +<p><></p> +>>> Autolinks - 599 +< http://foo.bar > +<<< +<p>< <a href="http://foo.bar">http://foo.bar</a> ></p> +>>> Autolinks - 600 +<m:abc> +<<< +<p><m:abc></p> +>>> Autolinks - 601 +<foo.bar.baz> +<<< +<p><foo.bar.baz></p> +>>> Autolinks - 602 +http://example.com +<<< +<p><a href="http://example.com">http://example.com</a></p> +>>> Autolinks - 603 +foo@bar.example.com +<<< +<p>foo@bar.example.com</p>
diff --git a/pkgs/markdown/test/gfm/autolinks_extension.unit b/pkgs/markdown/test/gfm/autolinks_extension.unit new file mode 100644 index 0000000..8c11567 --- /dev/null +++ b/pkgs/markdown/test/gfm/autolinks_extension.unit
@@ -0,0 +1,68 @@ +>>> Autolinks (extension) - 604 +www.commonmark.org +<<< +<p><a href="http://www.commonmark.org">www.commonmark.org</a></p> +>>> Autolinks (extension) - 605 +Visit www.commonmark.org/help for more information. +<<< +<p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p> +>>> Autolinks (extension) - 606 +Visit www.commonmark.org. + +Visit www.commonmark.org/a.b. +<<< +<p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p> +<p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p> +>>> Autolinks (extension) - 607 +www.google.com/search?q=Markup+(business) + +(www.google.com/search?q=Markup+(business)) +<<< +<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p> +<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p> +>>> Autolinks (extension) - 608 +www.google.com/search?q=(business))+ok +<<< +<p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p> +>>> Autolinks (extension) - 609 +www.google.com/search?q=commonmark&hl=en + +www.google.com/search?q=commonmark&hl; +<<< +<p><a href="http://www.google.com/search?q=commonmark&hl=en">www.google.com/search?q=commonmark&hl=en</a></p> +<p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&hl;</p> +>>> Autolinks (extension) - 610 +www.commonmark.org/he<lp +<<< +<p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a><lp</p> +>>> Autolinks (extension) - 611 +http://commonmark.org + +(Visit https://encrypted.google.com/search?q=Markup+(business)) + +Anonymous FTP is available at ftp://foo.bar.baz. +<<< +<p><a href="http://commonmark.org">http://commonmark.org</a></p> +<p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p> +<p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p> +>>> Autolinks (extension) - 612 +foo@bar.baz +<<< +<p>foo@bar.baz</p> +>>> Autolinks (extension) - 613 +hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. +<<< +<p>hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.</p> +>>> Autolinks (extension) - 614 +a.b-c_d@a.b + +a.b-c_d@a.b. + +a.b-c_d@a.b- + +a.b-c_d@a.b_ +<<< +<p>a.b-c_d@a.b</p> +<p>a.b-c_d@a.b.</p> +<p>a.b-c_d@a.b-</p> +<p>a.b-c_d@a.b_</p>
diff --git a/pkgs/markdown/test/gfm/backslash_escapes.unit b/pkgs/markdown/test/gfm/backslash_escapes.unit new file mode 100644 index 0000000..fbf8fde --- /dev/null +++ b/pkgs/markdown/test/gfm/backslash_escapes.unit
@@ -0,0 +1,77 @@ +>>> Backslash escapes - 302 +\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ +<<< +<p>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~</p> +>>> Backslash escapes - 303 +\ \A\a\ \3\φ\« +<<< +<p>\ \A\a\ \3\φ\«</p> +>>> Backslash escapes - 304 +\*not emphasized* +\<br/> not a tag +\[not a link](/foo) +\`not code` +1\. not a list +\* not a list +\# not a heading +\[foo]: /url "not a reference" +<<< +<p>*not emphasized* +<br/> not a tag +[not a link](/foo) +`not code` +1. not a list +* not a list +# not a heading +[foo]: /url "not a reference"</p> +>>> Backslash escapes - 305 +\\*emphasis* +<<< +<p>\<em>emphasis</em></p> +>>> Backslash escapes - 306 +foo\ +bar +<<< +<p>foo<br /> +bar</p> +>>> Backslash escapes - 307 +`` \[\` `` +<<< +<p><code>\[\`</code></p> +>>> Backslash escapes - 308 + \[\] +<<< +<pre><code>\[\] +</code></pre> +>>> Backslash escapes - 309 +~~~ +\[\] +~~~ +<<< +<pre><code>\[\] +</code></pre> +>>> Backslash escapes - 310 +<http://example.com?find=\*> +<<< +<p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p> +>>> Backslash escapes - 311 +<a href="/bar\/)"> +<<< +<a href="/bar\/)"> +>>> Backslash escapes - 312 +[foo](/bar\* "ti\*tle") +<<< +<p><a href="/bar*" title="ti*tle">foo</a></p> +>>> Backslash escapes - 313 +[foo] + +[foo]: /bar\* "ti\*tle" +<<< +<p><a href="/bar*" title="ti*tle">foo</a></p> +>>> Backslash escapes - 314 +``` foo\+bar +foo +``` +<<< +<pre><code class="language-foo\+bar">foo +</code></pre>
diff --git a/pkgs/markdown/test/gfm/blank_lines.unit b/pkgs/markdown/test/gfm/blank_lines.unit new file mode 100644 index 0000000..8bab612 --- /dev/null +++ b/pkgs/markdown/test/gfm/blank_lines.unit
@@ -0,0 +1,12 @@ +>>> Blank lines - 191 + + +aaa + + +# aaa + + +<<< +<p>aaa</p> +<h1>aaa</h1>
diff --git a/pkgs/markdown/test/gfm/block_quotes.unit b/pkgs/markdown/test/gfm/block_quotes.unit new file mode 100644 index 0000000..91ee275 --- /dev/null +++ b/pkgs/markdown/test/gfm/block_quotes.unit
@@ -0,0 +1,204 @@ +>>> Block quotes - 200 +> # Foo +> bar +> baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 201 +># Foo +>bar +> baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 202 + > # Foo + > bar + > baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 203 + > # Foo + > bar + > baz +<<< +<pre><code>> # Foo +> bar +> baz +</code></pre> +>>> Block quotes - 204 +> # Foo +> bar +baz +<<< +<blockquote> +<h1>Foo</h1> +<p>bar +baz</p></blockquote> +>>> Block quotes - 205 +> bar +baz +> foo +<<< +<blockquote> +<p>bar +baz +foo</p></blockquote> +>>> Block quotes - 206 +> foo +--- +<<< +<blockquote> +<p>foo</p></blockquote> +<hr /> +>>> Block quotes - 207 +> - foo +- bar +<<< +<blockquote><ul><li>foo</li></ul></blockquote><ul><li>bar</li></ul> +>>> Block quotes - 208 +> foo + bar +<<< +<blockquote> +<pre><code>foo +</code></pre></blockquote> +<pre><code>bar +</code></pre> +>>> Block quotes - 209 +> ``` +foo +``` +<<< +<blockquote> +<pre><code>foo +</code></pre></blockquote> +<pre><code> +</code></pre> +>>> Block quotes - 210 +> foo + - bar +<<< +<blockquote> +<p>foo</p></blockquote> +<pre><code>- bar +</code></pre> +>>> Block quotes - 211 +> +<<< +<blockquote></blockquote> +>>> Block quotes - 212 +> +> +> +<<< +<blockquote></blockquote> +>>> Block quotes - 213 +> +> foo +> +<<< +<blockquote> +<p>foo</p></blockquote> +>>> Block quotes - 214 +> foo + +> bar +<<< +<blockquote> +<p>foo</p></blockquote> +<blockquote> +<p>bar</p></blockquote> +>>> Block quotes - 215 +> foo +> bar +<<< +<blockquote> +<p>foo +bar</p></blockquote> +>>> Block quotes - 216 +> foo +> +> bar +<<< +<blockquote> +<p>foo</p> +<p>bar</p></blockquote> +>>> Block quotes - 217 +foo +> bar +<<< +<p>foo</p> +<blockquote> +<p>bar</p></blockquote> +>>> Block quotes - 218 +> aaa +*** +> bbb +<<< +<blockquote> +<p>aaa</p></blockquote> +<hr /> +<blockquote> +<p>bbb</p></blockquote> +>>> Block quotes - 219 +> bar +baz +<<< +<blockquote> +<p>bar +baz</p></blockquote> +>>> Block quotes - 220 +> bar + +baz +<<< +<blockquote> +<p>bar</p></blockquote> +<p>baz</p> +>>> Block quotes - 221 +> bar +> +baz +<<< +<blockquote> +<p>bar</p> +<p>baz</p></blockquote> +>>> Block quotes - 222 +> > > foo +bar +<<< +<blockquote> +<blockquote> +<blockquote> +<p>foo +bar</p></blockquote></blockquote></blockquote> +>>> Block quotes - 223 +>>> foo +> bar +>>baz +<<< +<blockquote> +<blockquote> +<blockquote> +<p>foo +bar +baz</p></blockquote></blockquote></blockquote> +>>> Block quotes - 224 +> code + +> not code +<<< +<blockquote> +<pre><code>code +</code></pre></blockquote> +<blockquote> +<p> not code</p></blockquote>
diff --git a/pkgs/markdown/test/gfm/code_spans.unit b/pkgs/markdown/test/gfm/code_spans.unit new file mode 100644 index 0000000..f1bdbf3 --- /dev/null +++ b/pkgs/markdown/test/gfm/code_spans.unit
@@ -0,0 +1,95 @@ +>>> Code spans - 327 +`foo` +<<< +<p><code>foo</code></p> +>>> Code spans - 328 +`` foo ` bar `` +<<< +<p><code>foo ` bar</code></p> +>>> Code spans - 329 +` `` ` +<<< +<p><code>``</code></p> +>>> Code spans - 330 +` `` ` +<<< +<p><code>``</code></p> +>>> Code spans - 331 +` a` +<<< +<p><code>a</code></p> +>>> Code spans - 332 +` b ` +<<< +<p><code>b</code></p> +>>> Code spans - 333 +`` +foo +bar +baz +`` +<<< +<p><code>foo +bar +baz</code></p> +>>> Code spans - 334 +`` +foo +`` +<<< +<p><code>foo</code></p> +>>> Code spans - 335 +`foo bar +baz` +<<< +<p><code>foo bar +baz</code></p> +>>> Code spans - 336 +`foo\`bar` +<<< +<p><code>foo\</code>bar`</p> +>>> Code spans - 337 +``foo`bar`` +<<< +<p><code>foo`bar</code></p> +>>> Code spans - 338 +` foo `` bar ` +<<< +<p><code>foo `` bar</code></p> +>>> Code spans - 339 +*foo`*` +<<< +<p>*foo<code>*</code></p> +>>> Code spans - 340 +[not a `link](/foo`) +<<< +<p>[not a <code>link](/foo</code>)</p> +>>> Code spans - 341 +`<a href="`">` +<<< +<p><code><a href="</code>">`</p> +>>> Code spans - 342 +<a href="`">` +<<< +<p><a href="`">`</p> +>>> Code spans - 343 +`<http://foo.bar.`baz>` +<<< +<p><code><http://foo.bar.</code>baz>`</p> +>>> Code spans - 344 +<http://foo.bar.`baz>` +<<< +<p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p> +>>> Code spans - 345 +```foo`` +<<< +<pre><code class="language-foo``"> +</code></pre> +>>> Code spans - 346 +`foo +<<< +<p>`foo</p> +>>> Code spans - 347 +`foo``bar`` +<<< +<p>`foo<code>bar</code></p>
diff --git a/pkgs/markdown/test/gfm/disallowed_raw_html_extension.unit b/pkgs/markdown/test/gfm/disallowed_raw_html_extension.unit new file mode 100644 index 0000000..e3f0652 --- /dev/null +++ b/pkgs/markdown/test/gfm/disallowed_raw_html_extension.unit
@@ -0,0 +1,10 @@ +>>> Disallowed Raw HTML (extension) - 636 +<strong> <title> <style> <em> + +<blockquote> + <xmp> is disallowed. <XMP> is also disallowed. +</blockquote> +<<< +<p><strong> <title> <style> <em></p><blockquote> + <xmp> is disallowed. <XMP> is also disallowed. +</blockquote>
diff --git a/pkgs/markdown/test/gfm/emphasis_and_strong_emphasis.unit b/pkgs/markdown/test/gfm/emphasis_and_strong_emphasis.unit new file mode 100644 index 0000000..414471f --- /dev/null +++ b/pkgs/markdown/test/gfm/emphasis_and_strong_emphasis.unit
@@ -0,0 +1,527 @@ +>>> Emphasis and strong emphasis - 348 +*foo bar* +<<< +<p><em>foo bar</em></p> +>>> Emphasis and strong emphasis - 349 +a * foo bar* +<<< +<p>a * foo bar*</p> +>>> Emphasis and strong emphasis - 350 +a*"foo"* +<<< +<p>a*"foo"*</p> +>>> Emphasis and strong emphasis - 351 +* a * +<<< +<p><em> a </em></p> +>>> Emphasis and strong emphasis - 352 +foo*bar* +<<< +<p>foo<em>bar</em></p> +>>> Emphasis and strong emphasis - 353 +5*6*78 +<<< +<p>5<em>6</em>78</p> +>>> Emphasis and strong emphasis - 354 +_foo bar_ +<<< +<p><em>foo bar</em></p> +>>> Emphasis and strong emphasis - 355 +_ foo bar_ +<<< +<p>_ foo bar_</p> +>>> Emphasis and strong emphasis - 356 +a_"foo"_ +<<< +<p>a_"foo"_</p> +>>> Emphasis and strong emphasis - 357 +foo_bar_ +<<< +<p>foo_bar_</p> +>>> Emphasis and strong emphasis - 358 +5_6_78 +<<< +<p>5_6_78</p> +>>> Emphasis and strong emphasis - 359 +пристаням_стремятся_ +<<< +<p>пристаням_стремятся_</p> +>>> Emphasis and strong emphasis - 360 +aa_"bb"_cc +<<< +<p>aa_"bb"_cc</p> +>>> Emphasis and strong emphasis - 361 +foo-_(bar)_ +<<< +<p>foo-<em>(bar)</em></p> +>>> Emphasis and strong emphasis - 362 +_foo* +<<< +<p>_foo*</p> +>>> Emphasis and strong emphasis - 363 +*foo bar * +<<< +<p>*foo bar *</p> +>>> Emphasis and strong emphasis - 364 +*foo bar +* +<<< +<p>*foo bar</p><ul><li></li></ul> +>>> Emphasis and strong emphasis - 365 +*(*foo) +<<< +<p>*(*foo)</p> +>>> Emphasis and strong emphasis - 366 +*(*foo*)* +<<< +<p><em>(<em>foo</em>)</em></p> +>>> Emphasis and strong emphasis - 367 +*foo*bar +<<< +<p><em>foo</em>bar</p> +>>> Emphasis and strong emphasis - 368 +_foo bar _ +<<< +<p>_foo bar _</p> +>>> Emphasis and strong emphasis - 369 +_(_foo) +<<< +<p>_(_foo)</p> +>>> Emphasis and strong emphasis - 370 +_(_foo_)_ +<<< +<p><em>(<em>foo</em>)</em></p> +>>> Emphasis and strong emphasis - 371 +_foo_bar +<<< +<p>_foo_bar</p> +>>> Emphasis and strong emphasis - 372 +_пристаням_стремятся +<<< +<p>_пристаням_стремятся</p> +>>> Emphasis and strong emphasis - 373 +_foo_bar_baz_ +<<< +<p><em>foo_bar_baz</em></p> +>>> Emphasis and strong emphasis - 374 +_(bar)_. +<<< +<p><em>(bar)</em>.</p> +>>> Emphasis and strong emphasis - 375 +**foo bar** +<<< +<p><strong>foo bar</strong></p> +>>> Emphasis and strong emphasis - 376 +** foo bar** +<<< +<p>** foo bar**</p> +>>> Emphasis and strong emphasis - 377 +a**"foo"** +<<< +<p>a**"foo"**</p> +>>> Emphasis and strong emphasis - 378 +foo**bar** +<<< +<p>foo<strong>bar</strong></p> +>>> Emphasis and strong emphasis - 379 +__foo bar__ +<<< +<p><strong>foo bar</strong></p> +>>> Emphasis and strong emphasis - 380 +__ foo bar__ +<<< +<p>__ foo bar__</p> +>>> Emphasis and strong emphasis - 381 +__ +foo bar__ +<<< +<p>__ +foo bar__</p> +>>> Emphasis and strong emphasis - 382 +a__"foo"__ +<<< +<p>a__"foo"__</p> +>>> Emphasis and strong emphasis - 383 +foo__bar__ +<<< +<p>foo__bar__</p> +>>> Emphasis and strong emphasis - 384 +5__6__78 +<<< +<p>5__6__78</p> +>>> Emphasis and strong emphasis - 385 +пристаням__стремятся__ +<<< +<p>пристаням__стремятся__</p> +>>> Emphasis and strong emphasis - 386 +__foo, __bar__, baz__ +<<< +<p><strong>foo, <strong>bar</strong>, baz</strong></p> +>>> Emphasis and strong emphasis - 387 +foo-__(bar)__ +<<< +<p>foo-<strong>(bar)</strong></p> +>>> Emphasis and strong emphasis - 388 +**foo bar ** +<<< +<p>**foo bar **</p> +>>> Emphasis and strong emphasis - 389 +**(**foo) +<<< +<p>**(**foo)</p> +>>> Emphasis and strong emphasis - 390 +*(**foo**)* +<<< +<p><em>(<strong>foo</strong>)</em></p> +>>> Emphasis and strong emphasis - 391 +**Gomphocarpus (*Gomphocarpus physocarpus*, syn. +*Asclepias physocarpa*)** +<<< +<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn. +<em>Asclepias physocarpa</em>)</strong></p> +>>> Emphasis and strong emphasis - 392 +**foo "*bar*" foo** +<<< +<p><strong>foo "<em>bar</em>" foo</strong></p> +>>> Emphasis and strong emphasis - 393 +**foo**bar +<<< +<p><strong>foo</strong>bar</p> +>>> Emphasis and strong emphasis - 394 +__foo bar __ +<<< +<p>__foo bar __</p> +>>> Emphasis and strong emphasis - 395 +__(__foo) +<<< +<p>__(__foo)</p> +>>> Emphasis and strong emphasis - 396 +_(__foo__)_ +<<< +<p><em>(<strong>foo</strong>)</em></p> +>>> Emphasis and strong emphasis - 397 +__foo__bar +<<< +<p>__foo__bar</p> +>>> Emphasis and strong emphasis - 398 +__пристаням__стремятся +<<< +<p>__пристаням__стремятся</p> +>>> Emphasis and strong emphasis - 399 +__foo__bar__baz__ +<<< +<p><strong>foo__bar__baz</strong></p> +>>> Emphasis and strong emphasis - 400 +__(bar)__. +<<< +<p><strong>(bar)</strong>.</p> +>>> Emphasis and strong emphasis - 401 +*foo [bar](/url)* +<<< +<p><em>foo <a href="/url">bar</a></em></p> +>>> Emphasis and strong emphasis - 402 +*foo +bar* +<<< +<p><em>foo +bar</em></p> +>>> Emphasis and strong emphasis - 403 +_foo __bar__ baz_ +<<< +<p><em>foo <strong>bar</strong> baz</em></p> +>>> Emphasis and strong emphasis - 404 +_foo _bar_ baz_ +<<< +<p><em>foo <em>bar</em> baz</em></p> +>>> Emphasis and strong emphasis - 405 +__foo_ bar_ +<<< +<p><em><em>foo</em> bar</em></p> +>>> Emphasis and strong emphasis - 406 +*foo *bar** +<<< +<p><em>foo <em>bar</em></em></p> +>>> Emphasis and strong emphasis - 407 +*foo **bar** baz* +<<< +<p><em>foo <strong>bar</strong> baz</em></p> +>>> Emphasis and strong emphasis - 408 +*foo**bar**baz* +<<< +<p><em>foo<strong>bar</strong>baz</em></p> +>>> Emphasis and strong emphasis - 409 +*foo**bar* +<<< +<p><em>foo**bar</em></p> +>>> Emphasis and strong emphasis - 410 +***foo** bar* +<<< +<p><em><strong>foo</strong> bar</em></p> +>>> Emphasis and strong emphasis - 411 +*foo **bar*** +<<< +<p><em>foo <strong>bar</strong></em></p> +>>> Emphasis and strong emphasis - 412 +*foo**bar*** +<<< +<p><em>foo<strong>bar</strong></em></p> +>>> Emphasis and strong emphasis - 413 +*foo **bar *baz* bim** bop* +<<< +<p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p> +>>> Emphasis and strong emphasis - 414 +*foo [*bar*](/url)* +<<< +<p><em>foo <a href="/url"><em>bar</em></a></em></p> +>>> Emphasis and strong emphasis - 415 +** is not an empty emphasis +<<< +<p>** is not an empty emphasis</p> +>>> Emphasis and strong emphasis - 416 +**** is not an empty strong emphasis +<<< +<p>**** is not an empty strong emphasis</p> +>>> Emphasis and strong emphasis - 417 +**foo [bar](/url)** +<<< +<p><strong>foo <a href="/url">bar</a></strong></p> +>>> Emphasis and strong emphasis - 418 +**foo +bar** +<<< +<p><strong>foo +bar</strong></p> +>>> Emphasis and strong emphasis - 419 +__foo _bar_ baz__ +<<< +<p><strong>foo <em>bar</em> baz</strong></p> +>>> Emphasis and strong emphasis - 420 +__foo __bar__ baz__ +<<< +<p><strong>foo <strong>bar</strong> baz</strong></p> +>>> Emphasis and strong emphasis - 421 +____foo__ bar__ +<<< +<p><strong><strong>foo</strong> bar</strong></p> +>>> Emphasis and strong emphasis - 422 +**foo **bar**** +<<< +<p><strong>foo <strong>bar</strong></strong></p> +>>> Emphasis and strong emphasis - 423 +**foo *bar* baz** +<<< +<p><strong>foo <em>bar</em> baz</strong></p> +>>> Emphasis and strong emphasis - 424 +**foo*bar*baz** +<<< +<p><strong>foo<em>bar</em>baz</strong></p> +>>> Emphasis and strong emphasis - 425 +***foo* bar** +<<< +<p><strong><em>foo</em> bar</strong></p> +>>> Emphasis and strong emphasis - 426 +**foo *bar*** +<<< +<p><strong>foo <em>bar</em></strong></p> +>>> Emphasis and strong emphasis - 427 +**foo *bar **baz** +bim* bop** +<<< +<p><strong>foo <em>bar <strong>baz</strong> +bim</em> bop</strong></p> +>>> Emphasis and strong emphasis - 428 +**foo [*bar*](/url)** +<<< +<p><strong>foo <a href="/url"><em>bar</em></a></strong></p> +>>> Emphasis and strong emphasis - 429 +__ is not an empty emphasis +<<< +<p>__ is not an empty emphasis</p> +>>> Emphasis and strong emphasis - 430 +____ is not an empty strong emphasis +<<< +<p>____ is not an empty strong emphasis</p> +>>> Emphasis and strong emphasis - 431 +foo *** +<<< +<p>foo ***</p> +>>> Emphasis and strong emphasis - 432 +foo *\** +<<< +<p>foo <em>*</em></p> +>>> Emphasis and strong emphasis - 433 +foo *_* +<<< +<p>foo <em>_</em></p> +>>> Emphasis and strong emphasis - 434 +foo ***** +<<< +<p>foo *****</p> +>>> Emphasis and strong emphasis - 435 +foo **\*** +<<< +<p>foo <strong>*</strong></p> +>>> Emphasis and strong emphasis - 436 +foo **_** +<<< +<p>foo <strong>_</strong></p> +>>> Emphasis and strong emphasis - 437 +**foo* +<<< +<p>*<em>foo</em></p> +>>> Emphasis and strong emphasis - 438 +*foo** +<<< +<p><em>foo</em>*</p> +>>> Emphasis and strong emphasis - 439 +***foo** +<<< +<p>*<strong>foo</strong></p> +>>> Emphasis and strong emphasis - 440 +****foo* +<<< +<p>***<em>foo</em></p> +>>> Emphasis and strong emphasis - 441 +**foo*** +<<< +<p><strong>foo</strong>*</p> +>>> Emphasis and strong emphasis - 442 +*foo**** +<<< +<p><em>foo</em>***</p> +>>> Emphasis and strong emphasis - 443 +foo ___ +<<< +<p>foo ___</p> +>>> Emphasis and strong emphasis - 444 +foo _\__ +<<< +<p>foo <em>_</em></p> +>>> Emphasis and strong emphasis - 445 +foo _*_ +<<< +<p>foo <em>*</em></p> +>>> Emphasis and strong emphasis - 446 +foo _____ +<<< +<p>foo _____</p> +>>> Emphasis and strong emphasis - 447 +foo __\___ +<<< +<p>foo <strong>_</strong></p> +>>> Emphasis and strong emphasis - 448 +foo __*__ +<<< +<p>foo <strong>*</strong></p> +>>> Emphasis and strong emphasis - 449 +__foo_ +<<< +<p>_<em>foo</em></p> +>>> Emphasis and strong emphasis - 450 +_foo__ +<<< +<p><em>foo</em>_</p> +>>> Emphasis and strong emphasis - 451 +___foo__ +<<< +<p>_<strong>foo</strong></p> +>>> Emphasis and strong emphasis - 452 +____foo_ +<<< +<p>___<em>foo</em></p> +>>> Emphasis and strong emphasis - 453 +__foo___ +<<< +<p><strong>foo</strong>_</p> +>>> Emphasis and strong emphasis - 454 +_foo____ +<<< +<p><em>foo</em>___</p> +>>> Emphasis and strong emphasis - 455 +**foo** +<<< +<p><strong>foo</strong></p> +>>> Emphasis and strong emphasis - 456 +*_foo_* +<<< +<p><em><em>foo</em></em></p> +>>> Emphasis and strong emphasis - 457 +__foo__ +<<< +<p><strong>foo</strong></p> +>>> Emphasis and strong emphasis - 458 +_*foo*_ +<<< +<p><em><em>foo</em></em></p> +>>> Emphasis and strong emphasis - 459 +****foo**** +<<< +<p><strong><strong>foo</strong></strong></p> +>>> Emphasis and strong emphasis - 460 +____foo____ +<<< +<p><strong><strong>foo</strong></strong></p> +>>> Emphasis and strong emphasis - 461 +******foo****** +<<< +<p><strong><strong><strong>foo</strong></strong></strong></p> +>>> Emphasis and strong emphasis - 462 +***foo*** +<<< +<p><em><strong>foo</strong></em></p> +>>> Emphasis and strong emphasis - 463 +_____foo_____ +<<< +<p><em><strong><strong>foo</strong></strong></em></p> +>>> Emphasis and strong emphasis - 464 +*foo _bar* baz_ +<<< +<p><em>foo _bar</em> baz_</p> +>>> Emphasis and strong emphasis - 465 +*foo __bar *baz bim__ bam* +<<< +<p><em>foo <strong>bar *baz bim</strong> bam</em></p> +>>> Emphasis and strong emphasis - 466 +**foo **bar baz** +<<< +<p>**foo <strong>bar baz</strong></p> +>>> Emphasis and strong emphasis - 467 +*foo *bar baz* +<<< +<p>*foo <em>bar baz</em></p> +>>> Emphasis and strong emphasis - 468 +*[bar*](/url) +<<< +<p><em>[bar</em>](/url)</p> +>>> Emphasis and strong emphasis - 469 +_foo [bar_](/url) +<<< +<p><em>foo [bar</em>](/url)</p> +>>> Emphasis and strong emphasis - 470 +*<img src="foo" title="*"/> +<<< +<p>*<img src="foo" title="*"/></p> +>>> Emphasis and strong emphasis - 471 +**<a href="**"> +<<< +<p>**<a href="**"></p> +>>> Emphasis and strong emphasis - 472 +__<a href="__"> +<<< +<p>__<a href="__"></p> +>>> Emphasis and strong emphasis - 473 +*a `*`* +<<< +<p><em>a <code>*</code></em></p> +>>> Emphasis and strong emphasis - 474 +_a `_`_ +<<< +<p><em>a <code>_</code></em></p> +>>> Emphasis and strong emphasis - 475 +**a<http://foo.bar/?q=**> +<<< +<p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p> +>>> Emphasis and strong emphasis - 476 +__a<http://foo.bar/?q=__> +<<< +<p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p>
diff --git a/pkgs/markdown/test/gfm/entity_and_numeric_character_references.unit b/pkgs/markdown/test/gfm/entity_and_numeric_character_references.unit new file mode 100644 index 0000000..df7030b --- /dev/null +++ b/pkgs/markdown/test/gfm/entity_and_numeric_character_references.unit
@@ -0,0 +1,64 @@ +>>> Entity and numeric character references - 315 + & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸ +<<< +<p> & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸</p> +>>> Entity and numeric character references - 316 +# Ӓ Ϡ � +<<< +<p># Ӓ Ϡ �</p> +>>> Entity and numeric character references - 317 +" ആ ಫ +<<< +<p>" ആ ಫ</p> +>>> Entity and numeric character references - 318 +  &x; &#; &#x; +� +&#abcdef0; +&ThisIsNotDefined; &hi?; +<<< +<p>&nbsp &x; &#; &#x; +� +&#abcdef0; +&ThisIsNotDefined; &hi?;</p> +>>> Entity and numeric character references - 319 +© +<<< +<p>&copy</p> +>>> Entity and numeric character references - 320 +&MadeUpEntity; +<<< +<p>&MadeUpEntity;</p> +>>> Entity and numeric character references - 321 +<a href="öö.html"> +<<< +<a href="öö.html"> +>>> Entity and numeric character references - 322 +[foo](/föö "föö") +<<< +<p><a href="/föö" title="föö">foo</a></p> +>>> Entity and numeric character references - 323 +[foo] + +[foo]: /föö "föö" +<<< +<p><a href="/föö" title="föö">foo</a></p> +>>> Entity and numeric character references - 324 +``` föö +foo +``` +<<< +<pre><code class="language-f&ouml;&ouml;">foo +</code></pre> +>>> Entity and numeric character references - 325 +`föö` +<<< +<p><code>f&ouml;&ouml;</code></p> +>>> Entity and numeric character references - 326 + föfö +<<< +<pre><code>f&ouml;f&ouml; +</code></pre>
diff --git a/pkgs/markdown/test/gfm/fenced_code_blocks.unit b/pkgs/markdown/test/gfm/fenced_code_blocks.unit new file mode 100644 index 0000000..a414fd8 --- /dev/null +++ b/pkgs/markdown/test/gfm/fenced_code_blocks.unit
@@ -0,0 +1,244 @@ +>>> Fenced code blocks - 88 +``` +< + > +``` +<<< +<pre><code>< + > +</code></pre> +>>> Fenced code blocks - 89 +~~~ +< + > +~~~ +<<< +<pre><code>< + > +</code></pre> +>>> Fenced code blocks - 90 +`` +foo +`` +<<< +<p><code>foo</code></p> +>>> Fenced code blocks - 91 +``` +aaa +~~~ +``` +<<< +<pre><code>aaa +~~~ +</code></pre> +>>> Fenced code blocks - 92 +~~~ +aaa +``` +~~~ +<<< +<pre><code>aaa +``` +</code></pre> +>>> Fenced code blocks - 93 +```` +aaa +``` +`````` +<<< +<pre><code>aaa +``` +</code></pre> +>>> Fenced code blocks - 94 +~~~~ +aaa +~~~ +~~~~ +<<< +<pre><code>aaa +~~~ +</code></pre> +>>> Fenced code blocks - 95 +``` +<<< +<pre><code> +</code></pre> +>>> Fenced code blocks - 96 +````` + +``` +aaa +<<< +<pre><code> +``` +aaa + +</code></pre> +>>> Fenced code blocks - 97 +> ``` +> aaa + +bbb +<<< +<blockquote> +<pre><code>aaa +</code></pre></blockquote> +<p>bbb</p> +>>> Fenced code blocks - 98 +``` + + +``` +<<< +<pre><code> + +</code></pre> +>>> Fenced code blocks - 99 +``` +``` +<<< +<pre><code></code></pre> +>>> Fenced code blocks - 100 + ``` + aaa +aaa +``` +<<< +<pre><code> aaa +aaa +</code></pre> +>>> Fenced code blocks - 101 + ``` +aaa + aaa +aaa + ``` +<<< +<pre><code>aaa + aaa +aaa +</code></pre> +>>> Fenced code blocks - 102 + ``` + aaa + aaa + aaa + ``` +<<< +<pre><code> aaa + aaa + aaa +</code></pre> +>>> Fenced code blocks - 103 + ``` + aaa + ``` +<<< +<pre><code>``` +aaa +``` +</code></pre> +>>> Fenced code blocks - 104 +``` +aaa + ``` +<<< +<pre><code>aaa +</code></pre> +>>> Fenced code blocks - 105 + ``` +aaa + ``` +<<< +<pre><code>aaa +</code></pre> +>>> Fenced code blocks - 106 +``` +aaa + ``` +<<< +<pre><code>aaa + ``` + +</code></pre> +>>> Fenced code blocks - 107 +``` ``` +aaa +<<< +<pre><code class="language-```">aaa + +</code></pre> +>>> Fenced code blocks - 108 +~~~~~~ +aaa +~~~ ~~ +<<< +<pre><code>aaa +~~~ ~~ + +</code></pre> +>>> Fenced code blocks - 109 +foo +``` +bar +``` +baz +<<< +<p>foo</p> +<pre><code>bar +</code></pre> +<p>baz</p> +>>> Fenced code blocks - 110 +foo +--- +~~~ +bar +~~~ +# baz +<<< +<h2>foo</h2> +<pre><code>bar +</code></pre> +<h1>baz</h1> +>>> Fenced code blocks - 111 +```ruby +def foo(x) + return 3 +end +``` +<<< +<pre><code class="language-ruby">def foo(x) + return 3 +end +</code></pre> +>>> Fenced code blocks - 112 +~~~~ ruby startline=3 $%@#$ +def foo(x) + return 3 +end +~~~~~~~ +<<< +<pre><code class="language-ruby">def foo(x) + return 3 +end +</code></pre> +>>> Fenced code blocks - 113 +````; +```` +<<< +<pre><code class="language-;"></code></pre> +>>> Fenced code blocks - 114 +``` aa ``` +foo +<<< +<pre><code class="language-aa">foo + +</code></pre> +>>> Fenced code blocks - 115 +``` +``` aaa +``` +<<< +<pre><code></code></pre> +<pre><code> +</code></pre>
diff --git a/pkgs/markdown/test/gfm/hard_line_breaks.unit b/pkgs/markdown/test/gfm/hard_line_breaks.unit new file mode 100644 index 0000000..591c6b8 --- /dev/null +++ b/pkgs/markdown/test/gfm/hard_line_breaks.unit
@@ -0,0 +1,82 @@ +>>> Hard line breaks - 637 +foo +baz +<<< +<p>foo<br /> +baz</p> +>>> Hard line breaks - 638 +foo\ +baz +<<< +<p>foo<br /> +baz</p> +>>> Hard line breaks - 639 +foo +baz +<<< +<p>foo<br /> +baz</p> +>>> Hard line breaks - 640 +foo + bar +<<< +<p>foo<br /> + bar</p> +>>> Hard line breaks - 641 +foo\ + bar +<<< +<p>foo<br /> + bar</p> +>>> Hard line breaks - 642 +*foo +bar* +<<< +<p><em>foo<br /> +bar</em></p> +>>> Hard line breaks - 643 +*foo\ +bar* +<<< +<p><em>foo<br /> +bar</em></p> +>>> Hard line breaks - 644 +`code +span` +<<< +<p><code>code +span</code></p> +>>> Hard line breaks - 645 +`code\ +span` +<<< +<p><code>code\ +span</code></p> +>>> Hard line breaks - 646 +<a href="foo +bar"> +<<< +<p><a href="foo +bar"></p> +>>> Hard line breaks - 647 +<a href="foo\ +bar"> +<<< +<p><a href="foo\ +bar"></p> +>>> Hard line breaks - 648 +foo\ +<<< +<p>foo\</p> +>>> Hard line breaks - 649 +foo +<<< +<p>foo </p> +>>> Hard line breaks - 650 +### foo\ +<<< +<h3>foo\</h3> +>>> Hard line breaks - 651 +### foo +<<< +<h3>foo</h3>
diff --git a/pkgs/markdown/test/gfm/html_blocks.unit b/pkgs/markdown/test/gfm/html_blocks.unit new file mode 100644 index 0000000..c316e4b --- /dev/null +++ b/pkgs/markdown/test/gfm/html_blocks.unit
@@ -0,0 +1,415 @@ +>>> HTML blocks - 116 +<table><tr><td> +<pre> +**Hello**, + +_world_. +</pre> +</td></tr></table> +<<< +<table><tr><td> +<pre> +**Hello**, +<p><em>world</em>. +</pre></p></td></tr></table> +>>> HTML blocks - 117 +<table> + <tr> + <td> + hi + </td> + </tr> +</table> + +okay. +<<< +<table> + <tr> + <td> + hi + </td> + </tr> +</table> +<p>okay.</p> +>>> HTML blocks - 118 + <div> + *hello* + <foo><a> +<<< + <div> + *hello* + <foo><a> +>>> HTML blocks - 119 +</div> +*foo* +<<< +</div> +*foo* +>>> HTML blocks - 120 +<DIV CLASS="foo"> + +*Markdown* + +</DIV> +<<< +<DIV CLASS="foo"> +<p><em>Markdown</em></p></DIV> +>>> HTML blocks - 121 +<div id="foo" + class="bar"> +</div> +<<< +<div id="foo" + class="bar"> +</div> +>>> HTML blocks - 122 +<div id="foo" class="bar + baz"> +</div> +<<< +<div id="foo" class="bar + baz"> +</div> +>>> HTML blocks - 123 +<div> +*foo* + +*bar* +<<< +<div> +*foo* +<p><em>bar</em></p> +>>> HTML blocks - 124 +<div id="foo" +*hi* +<<< +<div id="foo" +*hi* +>>> HTML blocks - 125 +<div class +foo +<<< +<div class +foo +>>> HTML blocks - 126 +<div *???-&&&-<--- +*foo* +<<< +<div *???-&&&-<--- +*foo* +>>> HTML blocks - 127 +<div><a href="bar">*foo*</a></div> +<<< +<div><a href="bar">*foo*</a></div> +>>> HTML blocks - 128 +<table><tr><td> +foo +</td></tr></table> +<<< +<table><tr><td> +foo +</td></tr></table> +>>> HTML blocks - 129 +<div></div> +``` c +int x = 33; +``` +<<< +<div></div> +``` c +int x = 33; +``` +>>> HTML blocks - 130 +<a href="foo"> +*bar* +</a> +<<< +<a href="foo"> +*bar* +</a> +>>> HTML blocks - 131 +<Warning> +*bar* +</Warning> +<<< +<Warning> +*bar* +</Warning> +>>> HTML blocks - 132 +<i class="foo"> +*bar* +</i> +<<< +<i class="foo"> +*bar* +</i> +>>> HTML blocks - 133 +</ins> +*bar* +<<< +</ins> +*bar* +>>> HTML blocks - 134 +<del> +*foo* +</del> +<<< +<del> +*foo* +</del> +>>> HTML blocks - 135 +<del> + +*foo* + +</del> +<<< +<del> +<p><em>foo</em></p></del> +>>> HTML blocks - 136 +<del>*foo*</del> +<<< +<p><del><em>foo</em></del></p> +>>> HTML blocks - 137 +<pre language="haskell"><code> +import Text.HTML.TagSoup + +main :: IO () +main = print $ parseTags tags +</code></pre> +okay +<<< +<pre language="haskell"><code> +import Text.HTML.TagSoup + +main :: IO () +main = print $ parseTags tags +</code></pre> +<p>okay</p> +>>> HTML blocks - 138 +<script type="text/javascript"> +// JavaScript example + +document.getElementById("demo").innerHTML = "Hello JavaScript!"; +</script> +okay +<<< +<script type="text/javascript"> +// JavaScript example + +document.getElementById("demo").innerHTML = "Hello JavaScript!"; +</script> +<p>okay</p> +>>> HTML blocks - 139 +<style + type="text/css"> +h1 {color:red;} + +p {color:blue;} +</style> +okay +<<< +<style + type="text/css"> +h1 {color:red;} + +p {color:blue;} +</style> +<p>okay</p> +>>> HTML blocks - 140 +<style + type="text/css"> + +foo +<<< +<style + type="text/css"> + +foo + +>>> HTML blocks - 141 +> <div> +> foo + +bar +<<< +<blockquote><div> +foo</blockquote> +<p>bar</p> +>>> HTML blocks - 142 +- <div> +- foo +<<< +<ul><li><div></li><li>foo</li></ul> +>>> HTML blocks - 143 +<style>p{color:red;}</style> +*foo* +<<< +<style>p{color:red;}</style> +<p><em>foo</em></p> +>>> HTML blocks - 144 +<!-- foo -->*bar* +*baz* +<<< +<!-- foo -->*bar* +<p><em>baz</em></p> +>>> HTML blocks - 145 +<script> +foo +</script>1. *bar* +<<< +<script> +foo +</script>1. *bar* +>>> HTML blocks - 146 +<!-- Foo + +bar + baz --> +okay +<<< +<!-- Foo + +bar + baz --> +<p>okay</p> +>>> HTML blocks - 147 +<?php + + echo '>'; + +?> +okay +<<< +<?php + + echo '>'; + +?> +<p>okay</p> +>>> HTML blocks - 148 +<!DOCTYPE html> +<<< +<!DOCTYPE html> +>>> HTML blocks - 149 +<![CDATA[ +function matchwo(a,b) +{ + if (a < b && a < 0) then { + return 1; + + } else { + + return 0; + } +} +]]> +okay +<<< +<![CDATA[ +function matchwo(a,b) +{ + if (a < b && a < 0) then { + return 1; + + } else { + + return 0; + } +} +]]> +<p>okay</p> +>>> HTML blocks - 150 + <!-- foo --> + + <!-- foo --> +<<< + <!-- foo --> +<pre><code><!-- foo --> +</code></pre> +>>> HTML blocks - 151 + <div> + + <div> +<<< + <div> +<pre><code><div> +</code></pre> +>>> HTML blocks - 152 +Foo +<div> +bar +</div> +<<< +<p>Foo</p><div> +bar +</div> +>>> HTML blocks - 153 +<div> +bar +</div> +*foo* +<<< +<div> +bar +</div> +*foo* +>>> HTML blocks - 154 +Foo +<a href="bar"> +baz +<<< +<p>Foo +<a href="bar"> +baz</p> +>>> HTML blocks - 155 +<div> + +*Emphasized* text. + +</div> +<<< +<div> +<p><em>Emphasized</em> text.</p></div> +>>> HTML blocks - 156 +<div> +*Emphasized* text. +</div> +<<< +<div> +*Emphasized* text. +</div> +>>> HTML blocks - 157 +<table> + +<tr> + +<td> +Hi +</td> + +</tr> + +</table> +<<< +<table><tr><td> +Hi +</td></tr></table> +>>> HTML blocks - 158 +<table> + + <tr> + + <td> + Hi + </td> + + </tr> + +</table> +<<< +<table> <tr> +<pre><code><td> + Hi +</td> +</code></pre> </tr></table>
diff --git a/pkgs/markdown/test/gfm/images.unit b/pkgs/markdown/test/gfm/images.unit new file mode 100644 index 0000000..7d3c96d --- /dev/null +++ b/pkgs/markdown/test/gfm/images.unit
@@ -0,0 +1,121 @@ +>>> Images - 563 + +<<< +<p><img src="/url" alt="foo" title="title" /></p> +>>> Images - 564 +![foo *bar*] + +[foo *bar*]: train.jpg "train & tracks" +<<< +<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> +>>> Images - 565 +](/url2) +<<< +<p></p> +>>> Images - 566 +](/url2) +<<< +<p><img src="/url2" alt="foo bar" /></p> +>>> Images - 567 +![foo *bar*][] + +[foo *bar*]: train.jpg "train & tracks" +<<< +<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> +>>> Images - 568 +![foo *bar*][foobar] + +[FOOBAR]: train.jpg "train & tracks" +<<< +<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> +>>> Images - 569 + +<<< +<p><img src="train.jpg" alt="foo" /></p> +>>> Images - 570 +My  +<<< +<p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p> +>>> Images - 571 + +<<< +<p><img src="url" alt="foo" /></p> +>>> Images - 572 + +<<< +<p><img src="/url" alt="" /></p> +>>> Images - 573 +![foo][bar] + +[bar]: /url +<<< +<p><img src="/url" alt="foo" /></p> +>>> Images - 574 +![foo][bar] + +[BAR]: /url +<<< +<p><img src="/url" alt="foo" /></p> +>>> Images - 575 +![foo][] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="foo" title="title" /></p> +>>> Images - 576 +![*foo* bar][] + +[*foo* bar]: /url "title" +<<< +<p><img src="/url" alt="foo bar" title="title" /></p> +>>> Images - 577 +![Foo][] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="Foo" title="title" /></p> +>>> Images - 578 +![foo] +[] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="foo" title="title" /> +[]</p> +>>> Images - 579 +![foo] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="foo" title="title" /></p> +>>> Images - 580 +![*foo* bar] + +[*foo* bar]: /url "title" +<<< +<p><img src="/url" alt="foo bar" title="title" /></p> +>>> Images - 581 +![[foo]] + +[[foo]]: /url "title" +<<< +<p>![[foo]]</p> +<p>[[foo]]: /url "title"</p> +>>> Images - 582 +![Foo] + +[foo]: /url "title" +<<< +<p><img src="/url" alt="Foo" title="title" /></p> +>>> Images - 583 +!\[foo] + +[foo]: /url "title" +<<< +<p>![foo]</p> +>>> Images - 584 +\![foo] + +[foo]: /url "title" +<<< +<p>!<a href="/url" title="title">foo</a></p>
diff --git a/pkgs/markdown/test/gfm/indented_code_blocks.unit b/pkgs/markdown/test/gfm/indented_code_blocks.unit new file mode 100644 index 0000000..ad4a07a --- /dev/null +++ b/pkgs/markdown/test/gfm/indented_code_blocks.unit
@@ -0,0 +1,108 @@ +>>> Indented code blocks - 76 + a simple + indented code block +<<< +<pre><code>a simple + indented code block +</code></pre> +>>> Indented code blocks - 77 + - foo + + bar +<<< +<ul><li> +<p>foo</p> +<p>bar</p></li></ul> +>>> Indented code blocks - 78 +1. foo + + - bar +<<< +<ol><li> +<p> foo</p><ul><li>bar</li></ul></li></ol> +>>> Indented code blocks - 79 + <a/> + *hi* + + - one +<<< +<pre><code><a/> +*hi* + +- one +</code></pre> +>>> Indented code blocks - 80 + chunk1 + + chunk2 + + + + chunk3 +<<< +<pre><code>chunk1 + +chunk2 +</code></pre> +<pre><code>chunk3 +</code></pre> +>>> Indented code blocks - 81 + chunk1 + + chunk2 +<<< +<pre><code>chunk1 + + chunk2 +</code></pre> +>>> Indented code blocks - 82 +Foo + bar + +<<< +<p>Foo + bar</p> +>>> Indented code blocks - 83 + foo +bar +<<< +<pre><code>foo +</code></pre> +<p>bar</p> +>>> Indented code blocks - 84 +# Heading + foo +Heading +------ + foo +---- +<<< +<h1>Heading</h1> +<pre><code>foo +</code></pre> +<h2>Heading</h2> +<pre><code>foo +</code></pre> +<hr /> +>>> Indented code blocks - 85 + foo + bar +<<< +<pre><code> foo +bar +</code></pre> +>>> Indented code blocks - 86 + + + foo + + +<<< +<pre><code>foo + +</code></pre> +>>> Indented code blocks - 87 + foo +<<< +<pre><code>foo +</code></pre>
diff --git a/pkgs/markdown/test/gfm/inlines.unit b/pkgs/markdown/test/gfm/inlines.unit new file mode 100644 index 0000000..44b1676 --- /dev/null +++ b/pkgs/markdown/test/gfm/inlines.unit
@@ -0,0 +1,4 @@ +>>> Inlines - 301 +`hi`lo` +<<< +<p><code>hi</code>lo`</p>
diff --git a/pkgs/markdown/test/gfm/link_reference_definitions.unit b/pkgs/markdown/test/gfm/link_reference_definitions.unit new file mode 100644 index 0000000..fdddad3 --- /dev/null +++ b/pkgs/markdown/test/gfm/link_reference_definitions.unit
@@ -0,0 +1,182 @@ +>>> Link reference definitions - 159 +[foo]: /url "title" + +[foo] +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Link reference definitions - 160 + [foo]: + /url + 'the title' + +[foo] +<<< +<p><a href="/url" title="the title">foo</a></p> +>>> Link reference definitions - 161 +[Foo*bar\]]:my_(url) 'title (with parens)' + +[Foo*bar\]] +<<< +<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p> +>>> Link reference definitions - 162 +[Foo bar]: +<my url> +'title' + +[Foo bar] +<<< +<p>[Foo bar]: +<my url> +'title'</p> +<p>[Foo bar]</p> +>>> Link reference definitions - 163 +[foo]: /url ' +title +line1 +line2 +' + +[foo] +<<< +<p><a href="/url" title=" +title +line1 +line2 +">foo</a></p> +>>> Link reference definitions - 164 +[foo]: /url 'title + +with blank line' + +[foo] +<<< +<p>[foo]: /url 'title</p> +<p>with blank line'</p> +<p>[foo]</p> +>>> Link reference definitions - 165 +[foo]: +/url + +[foo] +<<< +<p><a href="/url">foo</a></p> +>>> Link reference definitions - 166 +[foo]: + +[foo] +<<< +<p>[foo]:</p> +<p>[foo]</p> +>>> Link reference definitions - 167 +[foo]: <bar>(baz) + +[foo] +<<< +<p><a href="bar" title="baz">foo</a></p> +>>> Link reference definitions - 168 +[foo]: /url\bar\*baz "foo\"bar\baz" + +[foo] +<<< +<p>[foo]: /url\bar*baz "foo"bar\baz"</p> +<p>[foo]</p> +>>> Link reference definitions - 169 +[foo] + +[foo]: url +<<< +<p><a href="url">foo</a></p> +>>> Link reference definitions - 170 +[foo] + +[foo]: first +[foo]: second +<<< +<p><a href="first">foo</a></p> +>>> Link reference definitions - 171 +[FOO]: /url + +[Foo] +<<< +<p><a href="/url">Foo</a></p> +>>> Link reference definitions - 172 +[ΑΓΩ]: /φου + +[αγω] +<<< +<p><a href="/φου">αγω</a></p> +>>> Link reference definitions - 173 +[foo]: /url +<<< + +>>> Link reference definitions - 174 +[ +foo +]: /url +bar +<<< +<p>bar</p> +>>> Link reference definitions - 175 +[foo]: /url "title" ok +<<< +<p>[foo]: /url "title" ok</p> +>>> Link reference definitions - 176 +[foo]: /url +"title" ok +<<< +<p>"title" ok</p> +>>> Link reference definitions - 177 + [foo]: /url "title" + +[foo] +<<< +<pre><code>[foo]: /url "title" +</code></pre> +<p>[foo]</p> +>>> Link reference definitions - 178 +``` +[foo]: /url +``` + +[foo] +<<< +<pre><code>[foo]: /url +</code></pre> +<p>[foo]</p> +>>> Link reference definitions - 179 +Foo +[bar]: /baz + +[bar] +<<< +<p>Foo +[bar]: /baz</p> +<p>[bar]</p> +>>> Link reference definitions - 180 +# [Foo] +[foo]: /url +> bar +<<< +<h1><a href="/url">Foo</a></h1> +<blockquote> +<p>bar</p></blockquote> +>>> Link reference definitions - 181 +[foo]: /foo-url "foo" +[bar]: /bar-url + "bar" +[baz]: /baz-url + +[foo], +[bar], +[baz] +<<< +<p><a href="/foo-url" title="foo">foo</a>, +<a href="/bar-url" title="bar">bar</a>, +<a href="/baz-url">baz</a></p> +>>> Link reference definitions - 182 +[foo] + +> [foo]: /url +<<< +<p><a href="/url">foo</a></p> +<blockquote></blockquote>
diff --git a/pkgs/markdown/test/gfm/links.unit b/pkgs/markdown/test/gfm/links.unit new file mode 100644 index 0000000..73292a1 --- /dev/null +++ b/pkgs/markdown/test/gfm/links.unit
@@ -0,0 +1,459 @@ +>>> Links - 479 +[link](/uri "title") +<<< +<p><a href="/uri" title="title">link</a></p> +>>> Links - 480 +[link](/uri) +<<< +<p><a href="/uri">link</a></p> +>>> Links - 481 +[link]() +<<< +<p><a href="">link</a></p> +>>> Links - 482 +[link](<>) +<<< +<p><a href="">link</a></p> +>>> Links - 483 +[link](/my uri) +<<< +<p>[link](/my uri)</p> +>>> Links - 484 +[link](</my uri>) +<<< +<p>[link](</my uri>)</p> +>>> Links - 485 +[link](foo +bar) +<<< +<p>[link](foo +bar)</p> +>>> Links - 486 +[link](<foo +bar>) +<<< +<p>[link](<foo +bar>)</p> +>>> Links - 487 +[link](\(foo\)) +<<< +<p><a href="(foo)">link</a></p> +>>> Links - 488 +[link](foo(and(bar))) +<<< +<p><a href="foo(and(bar))">link</a></p> +>>> Links - 489 +[link](foo\(and\(bar\)) +<<< +<p><a href="foo(and(bar)">link</a></p> +>>> Links - 490 +[link](<foo(and(bar)>) +<<< +<p><a href="foo(and(bar)">link</a></p> +>>> Links - 491 +[link](foo\)\:) +<<< +<p><a href="foo):">link</a></p> +>>> Links - 492 +[link](#fragment) + +[link](http://example.com#fragment) + +[link](http://example.com?foo=3#frag) +<<< +<p><a href="#fragment">link</a></p> +<p><a href="http://example.com#fragment">link</a></p> +<p><a href="http://example.com?foo=3#frag">link</a></p> +>>> Links - 493 +[link](foo\bar) +<<< +<p><a href="foo%5Cbar">link</a></p> +>>> Links - 494 +[link](foo%20bä) +<<< +<p><a href="foo%20bä">link</a></p> +>>> Links - 495 +[link]("title") +<<< +<p><a href="%22title%22">link</a></p> +>>> Links - 496 +[link](/url "title") +[link](/url 'title') +[link](/url (title)) +<<< +<p><a href="/url" title="title">link</a> +<a href="/url" title="title">link</a> +<a href="/url" title="title">link</a></p> +>>> Links - 497 +[link](/url "title \""") +<<< +<p><a href="/url" title="title %22"">link</a></p> +>>> Links - 498 +[link](/url "title") +<<< +<p><a href="/url %22title%22">link</a></p> +>>> Links - 499 +[link](/url "title "and" title") +<<< +<p>[link](/url "title "and" title")</p> +>>> Links - 500 +[link](/url 'title "and" title') +<<< +<p><a href="/url" title="title %22and%22 title">link</a></p> +>>> Links - 501 +[link]( /uri + "title" ) +<<< +<p><a href="/uri" title="title">link</a></p> +>>> Links - 502 +[link] (/uri) +<<< +<p>[link] (/uri)</p> +>>> Links - 503 +[link [foo [bar]]](/uri) +<<< +<p><a href="/uri">link [foo [bar]]</a></p> +>>> Links - 504 +[link] bar](/uri) +<<< +<p>[link] bar](/uri)</p> +>>> Links - 505 +[link [bar](/uri) +<<< +<p>[link <a href="/uri">bar</a></p> +>>> Links - 506 +[link \[bar](/uri) +<<< +<p><a href="/uri">link [bar</a></p> +>>> Links - 507 +[link *foo **bar** `#`*](/uri) +<<< +<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> +>>> Links - 508 +[](/uri) +<<< +<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> +>>> Links - 509 +[foo [bar](/uri)](/uri) +<<< +<p>[foo <a href="/uri">bar</a>](/uri)</p> +>>> Links - 510 +[foo *[bar [baz](/uri)](/uri)*](/uri) +<<< +<p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p> +>>> Links - 511 +](uri2)](uri3) +<<< +<p><img src="uri3" alt="[foo](uri2)" /></p> +>>> Links - 512 +*[foo*](/uri) +<<< +<p><em>[foo</em>](/uri)</p> +>>> Links - 513 +[foo *bar](baz*) +<<< +<p><a href="baz*">foo *bar</a></p> +>>> Links - 514 +*foo [bar* baz] +<<< +<p><em>foo [bar</em> baz]</p> +>>> Links - 515 +[foo <bar attr="](baz)"> +<<< +<p>[foo <bar attr="](baz)"></p> +>>> Links - 516 +[foo`](/uri)` +<<< +<p>[foo<code>](/uri)</code></p> +>>> Links - 517 +[foo<http://example.com/?search=](uri)> +<<< +<p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p> +>>> Links - 518 +[foo][bar] + +[bar]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 519 +[link [foo [bar]]][ref] + +[ref]: /uri +<<< +<p><a href="/uri">link [foo [bar]]</a></p> +>>> Links - 520 +[link \[bar][ref] + +[ref]: /uri +<<< +<p><a href="/uri">link [bar</a></p> +>>> Links - 521 +[link *foo **bar** `#`*][ref] + +[ref]: /uri +<<< +<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> +>>> Links - 522 +[][ref] + +[ref]: /uri +<<< +<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> +>>> Links - 523 +[foo [bar](/uri)][ref] + +[ref]: /uri +<<< +<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p> +>>> Links - 524 +[foo *bar [baz][ref]*][ref] + +[ref]: /uri +<<< +<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p> +>>> Links - 525 +*[foo*][ref] + +[ref]: /uri +<<< +<p><em>[foo</em>]<a href="/uri">ref</a></p> +>>> Links - 526 +[foo *bar][ref] + +[ref]: /uri +<<< +<p><a href="/uri">foo *bar</a></p> +>>> Links - 527 +[foo <bar attr="][ref]"> + +[ref]: /uri +<<< +<p>[foo <bar attr="][ref]"></p> +>>> Links - 528 +[foo`][ref]` + +[ref]: /uri +<<< +<p>[foo<code>][ref]</code></p> +>>> Links - 529 +[foo<http://example.com/?search=][ref]> + +[ref]: /uri +<<< +<p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p> +>>> Links - 530 +[foo][BaR] + +[bar]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 531 +[Толпой][Толпой] is a Russian word. + +[ТОЛПОЙ]: /url +<<< +<p><a href="/url">Толпой</a> is a Russian word.</p> +>>> Links - 532 +[Foo + bar]: /url + +[Baz][Foo bar] +<<< +<p><a href="/url">Baz</a></p> +>>> Links - 533 +[foo] [bar] + +[bar]: /url "title" +<<< +<p>[foo] <a href="/url" title="title">bar</a></p> +>>> Links - 534 +[foo] +[bar] + +[bar]: /url "title" +<<< +<p>[foo] +<a href="/url" title="title">bar</a></p> +>>> Links - 535 +[foo]: /url1 + +[foo]: /url2 + +[bar][foo] +<<< +<p><a href="/url1">bar</a></p> +>>> Links - 536 +[bar][foo\!] + +[foo!]: /url +<<< +<p>[bar][foo!]</p> +>>> Links - 537 +[foo][ref[] + +[ref[]: /uri +<<< +<p><a href="/uri">foo</a></p> +>>> Links - 538 +[foo][ref[bar]] + +[ref[bar]]: /uri +<<< +<p>[foo][ref[bar]]</p> +<p>[ref[bar]]: /uri</p> +>>> Links - 539 +[[[foo]]] + +[[[foo]]]: /url +<<< +<p>[[[foo]]]</p> +<p>[[[foo]]]: /url</p> +>>> Links - 540 +[foo][ref\[] + +[ref\[]: /uri +<<< +<p><a href="/uri">foo</a></p> +>>> Links - 541 +[bar\\]: /uri + +[bar\\] +<<< +<p><a href="/uri">bar\</a></p> +>>> Links - 542 +[] + +[]: /uri +<<< +<p>[]</p> +<p>[]: /uri</p> +>>> Links - 543 +[ + ] + +[ + ]: /uri +<<< +<p>[ + ]</p> +<p>[ + ]: /uri</p> +>>> Links - 544 +[foo][] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 545 +[*foo* bar][] + +[*foo* bar]: /url "title" +<<< +<p><a href="/url" title="title"><em>foo</em> bar</a></p> +>>> Links - 546 +[Foo][] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">Foo</a></p> +>>> Links - 547 +[foo] +[] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">foo</a> +[]</p> +>>> Links - 548 +[foo] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">foo</a></p> +>>> Links - 549 +[*foo* bar] + +[*foo* bar]: /url "title" +<<< +<p><a href="/url" title="title"><em>foo</em> bar</a></p> +>>> Links - 550 +[[*foo* bar]] + +[*foo* bar]: /url "title" +<<< +<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p> +>>> Links - 551 +[[bar [foo] + +[foo]: /url +<<< +<p>[[bar <a href="/url">foo</a></p> +>>> Links - 552 +[Foo] + +[foo]: /url "title" +<<< +<p><a href="/url" title="title">Foo</a></p> +>>> Links - 553 +[foo] bar + +[foo]: /url +<<< +<p><a href="/url">foo</a> bar</p> +>>> Links - 554 +\[foo] + +[foo]: /url "title" +<<< +<p>[foo]</p> +>>> Links - 555 +[foo*]: /url + +*[foo*] +<<< +<p><em>[foo</em>]</p> +>>> Links - 556 +[foo][bar] + +[foo]: /url1 +[bar]: /url2 +<<< +<p><a href="/url2">foo</a></p> +>>> Links - 557 +[foo][] + +[foo]: /url1 +<<< +<p><a href="/url1">foo</a></p> +>>> Links - 558 +[foo]() + +[foo]: /url1 +<<< +<p><a href="">foo</a></p> +>>> Links - 559 +[foo](not a link) + +[foo]: /url1 +<<< +<p><a href="/url1">foo</a>(not a link)</p> +>>> Links - 560 +[foo][bar][baz] + +[baz]: /url +<<< +<p>[foo]<a href="/url">bar</a></p> +>>> Links - 561 +[foo][bar][baz] + +[baz]: /url1 +[bar]: /url2 +<<< +<p><a href="/url2">foo</a><a href="/url1">baz</a></p> +>>> Links - 562 +[foo][bar][baz] + +[baz]: /url1 +[foo]: /url2 +<<< +<p>[foo]<a href="/url1">bar</a></p>
diff --git a/pkgs/markdown/test/gfm/list_items.unit b/pkgs/markdown/test/gfm/list_items.unit new file mode 100644 index 0000000..244e0c8 --- /dev/null +++ b/pkgs/markdown/test/gfm/list_items.unit
@@ -0,0 +1,418 @@ +>>> List items - 225 +A paragraph +with two lines. + + indented code + +> A block quote. +<<< +<p>A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote> +>>> List items - 226 +1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 227 +- one + + two +<<< +<ul><li>one</li></ul> +<p> two</p> +>>> List items - 228 +- one + + two +<<< +<ul><li> +<p>one</p> +<p>two</p></li></ul> +>>> List items - 229 + - one + + two +<<< +<ul><li> one</li></ul> +<pre><code> two +</code></pre> +>>> List items - 230 + - one + + two +<<< +<ul><li> +<p> one</p> +<p>two</p></li></ul> +>>> List items - 231 + > > 1. one +>> +>> two +<<< +<blockquote> +<blockquote><ol><li> +<p> one</p> +<p>two</p></li></ol></blockquote></blockquote> +>>> List items - 232 +>>- one +>> + > > two +<<< +<blockquote> +<blockquote><ul><li>one</li></ul> +<p>two</p></blockquote></blockquote> +>>> List items - 233 +-one + +2.two +<<< +<p>-one</p> +<p>2.two</p> +>>> List items - 234 +- foo + + + bar +<<< +<ul><li>foo</li></ul> +<p> bar</p> +>>> List items - 235 +1. foo + + ``` + bar + ``` + + baz + + > bam +<<< +<ol><li> +<p> foo</p> +<pre><code>bar +</code></pre> +<p>baz</p> +<blockquote> +<p>bam</p></blockquote></li></ol> +>>> List items - 236 +- Foo + + bar + + + baz +<<< +<ul><li> +<p>Foo</p> +<pre><code>bar +</code></pre></li></ul> +<pre><code> baz +</code></pre> +>>> List items - 237 +123456789. ok +<<< +<ol start="123456789"><li>ok</li></ol> +>>> List items - 238 +1234567890. not ok +<<< +<p>1234567890. not ok</p> +>>> List items - 239 +0. ok +<<< +<ol start="0"><li>ok</li></ol> +>>> List items - 240 +003. ok +<<< +<ol start="3"><li>ok</li></ol> +>>> List items - 241 +-1. not ok +<<< +<p>-1. not ok</p> +>>> List items - 242 +- foo + + bar +<<< +<ul><li> +<p>foo</p> +<pre><code>bar +</code></pre></li></ul> +>>> List items - 243 + 10. foo + + bar +<<< +<ol start="10"><li> +<p> foo</p> +<pre><code>bar +</code></pre></li></ol> +>>> List items - 244 + indented code + +paragraph + + more code +<<< +<pre><code>indented code +</code></pre> +<p>paragraph</p> +<pre><code>more code +</code></pre> +>>> List items - 245 +1. indented code + + paragraph + + more code +<<< +<ol><li> +<pre><code>indented code +</code></pre> +<p>paragraph</p> +<pre><code>more code +</code></pre></li></ol> +>>> List items - 246 +1. indented code + + paragraph + + more code +<<< +<ol><li> +<pre><code> indented code +</code></pre> +<p>paragraph</p> +<pre><code>more code +</code></pre></li></ol> +>>> List items - 247 + foo + +bar +<<< +<p> foo</p> +<p>bar</p> +>>> List items - 248 +- foo + + bar +<<< +<ul><li> foo</li></ul> +<p> bar</p> +>>> List items - 249 +- foo + + bar +<<< +<ul><li> +<p> foo</p> +<p>bar</p></li></ul> +>>> List items - 250 +- + foo +- + ``` + bar + ``` +- + baz +<<< +<ul><li>foo</li><li> +<pre><code>bar +</code></pre></li><li> +<pre><code>baz +</code></pre></li></ul> +>>> List items - 251 +- + foo +<<< +<ul><li>foo</li></ul> +>>> List items - 252 +- + + foo +<<< +<ul><li> +<p>foo</p></li></ul> +>>> List items - 253 +- foo +- +- bar +<<< +<ul><li>foo</li><li></li><li>bar</li></ul> +>>> List items - 254 +- foo +- +- bar +<<< +<ul><li>foo</li><li></li><li>bar</li></ul> +>>> List items - 255 +1. foo +2. +3. bar +<<< +<ol><li>foo</li><li></li><li>bar</li></ol> +>>> List items - 256 +* +<<< +<ul><li></li></ul> +>>> List items - 257 +foo +* + +foo +1. +<<< +<p>foo</p><ul><li></li></ul> +<p>foo</p><ol><li></li></ol> +>>> List items - 258 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 259 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 260 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 261 + 1. A paragraph + with two lines. + + indented code + + > A block quote. +<<< +<pre><code>1. A paragraph + with two lines. + + indented code + + > A block quote. +</code></pre> +>>> List items - 262 + 1. A paragraph +with two lines. + + indented code + + > A block quote. +<<< +<ol><li> +<p> A paragraph +with two lines.</p> +<pre><code>indented code +</code></pre> +<blockquote> +<p>A block quote.</p></blockquote></li></ol> +>>> List items - 263 + 1. A paragraph + with two lines. +<<< +<ol><li> A paragraph + with two lines.</li></ol> +>>> List items - 264 +> 1. > Blockquote +continued here. +<<< +<blockquote><ol><li> +<blockquote> +<p>Blockquote +continued here.</p></blockquote></li></ol></blockquote> +>>> List items - 265 +> 1. > Blockquote +> continued here. +<<< +<blockquote><ol><li> +<blockquote> +<p>Blockquote +continued here.</p></blockquote></li></ol></blockquote> +>>> List items - 266 +- foo + - bar + - baz + - boo +<<< +<ul><li>foo<ul><li>bar<ul><li>baz<ul><li>boo</li></ul></li></ul></li></ul></li></ul> +>>> List items - 267 +- foo + - bar + - baz + - boo +<<< +<ul><li>foo</li><li>bar</li><li>baz</li><li>boo</li></ul> +>>> List items - 268 +10) foo + - bar +<<< +<ol start="10"><li>foo<ul><li>bar</li></ul></li></ol> +>>> List items - 269 +10) foo + - bar +<<< +<ol start="10"><li>foo</li></ol><ul><li>bar</li></ul> +>>> List items - 270 +- - foo +<<< +<ul><li><ul><li>foo</li></ul></li></ul> +>>> List items - 271 +1. - 2. foo +<<< +<ol><li><ul><li><ol start="2"><li>foo</li></ol></li></ul></li></ol> +>>> List items - 272 +- # Foo +- Bar + --- + baz +<<< +<ul><li> +<h1>Foo</h1></li><li> +<h2>Bar</h2>baz</li></ul>
diff --git a/pkgs/markdown/test/gfm/lists.unit b/pkgs/markdown/test/gfm/lists.unit new file mode 100644 index 0000000..cae1ef7 --- /dev/null +++ b/pkgs/markdown/test/gfm/lists.unit
@@ -0,0 +1,249 @@ +>>> Lists - 275 +- foo +- bar ++ baz +<<< +<ul><li>foo</li><li>bar</li></ul><ul><li>baz</li></ul> +>>> Lists - 276 +1. foo +2. bar +3) baz +<<< +<ol><li>foo</li><li>bar</li></ol><ol start="3"><li>baz</li></ol> +>>> Lists - 277 +Foo +- bar +- baz +<<< +<p>Foo</p><ul><li>bar</li><li>baz</li></ul> +>>> Lists - 278 +The number of windows in my house is +14. The number of doors is 6. +<<< +<p>The number of windows in my house is</p><ol start="14"><li> The number of doors is 6.</li></ol> +>>> Lists - 279 +The number of windows in my house is +1. The number of doors is 6. +<<< +<p>The number of windows in my house is</p><ol><li> The number of doors is 6.</li></ol> +>>> Lists - 280 +- foo + +- bar + + +- baz +<<< +<ul><li> +<p>foo</p></li><li> +<p>bar</p></li></ul><ul><li>baz</li></ul> +>>> Lists - 281 +- foo + - bar + - baz + + + bim +<<< +<ul><li>foo<ul><li>bar<ul><li>baz</li></ul></li></ul></li></ul> +<pre><code> bim +</code></pre> +>>> Lists - 282 +- foo +- bar + +<!-- --> + +- baz +- bim +<<< +<ul><li>foo</li><li>bar</li></ul><!-- --><ul><li>baz</li><li>bim</li></ul> +>>> Lists - 283 +- foo + + notcode + +- foo + +<!-- --> + + code +<<< +<ul><li> +<p> foo</p> +<p>notcode</p></li><li> +<p> foo</p></li></ul><!-- --> +<pre><code>code +</code></pre> +>>> Lists - 284 +- a + - b + - c + - d + - e + - f +- g +<<< +<ul><li>a</li><li>b</li><li>c</li><li>d</li><li>e</li><li>f</li><li>g</li></ul> +>>> Lists - 285 +1. a + + 2. b + + 3. c +<<< +<ol><li> +<p>a</p></li><li> +<p>b</p></li><li> +<p>c</p></li></ol> +>>> Lists - 286 +- a + - b + - c + - d + - e +<<< +<ul><li>a</li><li>b</li><li>c</li><li>d + - e</li></ul> +>>> Lists - 287 +1. a + + 2. b + + 3. c +<<< +<ol><li> +<p>a</p></li><li> +<p>b</p></li></ol> +<pre><code>3. c +</code></pre> +>>> Lists - 288 +- a +- b + +- c +<<< +<ul><li> +<p>a</p></li><li> +<p>b</p></li><li> +<p>c</p></li></ul> +>>> Lists - 289 +* a +* + +* c +<<< +<ul><li> +<p>a</p></li><li></li><li> +<p>c</p></li></ul> +>>> Lists - 290 +- a +- b + + c +- d +<<< +<ul><li> +<p>a</p></li><li> +<p>b</p> +<p>c</p></li><li> +<p>d</p></li></ul> +>>> Lists - 291 +- a +- b + + [ref]: /url +- d +<<< +<ul><li> +<p>a</p></li><li> +<p>b</p></li><li> +<p>d</p></li></ul> +>>> Lists - 292 +- a +- ``` + b + + + ``` +- c +<<< +<ul><li>a</li><li> +<pre><code>b +</code></pre></li></ul> +<pre><code>- c + +</code></pre> +>>> Lists - 293 +- a + - b + + c +- d +<<< +<ul><li>a<ul><li> +<p>b</p> +<p>c</p></li></ul></li><li>d</li></ul> +>>> Lists - 294 +* a + > b + > +* c +<<< +<ul><li>a +<blockquote> +<p>b</p></blockquote></li><li>c</li></ul> +>>> Lists - 295 +- a + > b + ``` + c + ``` +- d +<<< +<ul><li>a +<blockquote> +<p>b</p></blockquote> +<pre><code>c +</code></pre></li><li>d</li></ul> +>>> Lists - 296 +- a +<<< +<ul><li>a</li></ul> +>>> Lists - 297 +- a + - b +<<< +<ul><li>a<ul><li>b</li></ul></li></ul> +>>> Lists - 298 +1. ``` + foo + ``` + + bar +<<< +<ol><li> +<pre><code>foo +</code></pre> +<p>bar</p></li></ol> +>>> Lists - 299 +* foo + * bar + + baz +<<< +<ul><li> +<p>foo</p><ul><li>bar</li></ul> +<p>baz</p></li></ul> +>>> Lists - 300 +- a + - b + - c + +- d + - e + - f +<<< +<ul><li> +<p>a</p><ul><li>b</li><li>c</li></ul></li><li> +<p>d</p><ul><li>e</li><li>f</li></ul></li></ul>
diff --git a/pkgs/markdown/test/gfm/paragraphs.unit b/pkgs/markdown/test/gfm/paragraphs.unit new file mode 100644 index 0000000..f365d21 --- /dev/null +++ b/pkgs/markdown/test/gfm/paragraphs.unit
@@ -0,0 +1,59 @@ +>>> Paragraphs - 183 +aaa + +bbb +<<< +<p>aaa</p> +<p>bbb</p> +>>> Paragraphs - 184 +aaa +bbb + +ccc +ddd +<<< +<p>aaa +bbb</p> +<p>ccc +ddd</p> +>>> Paragraphs - 185 +aaa + + +bbb +<<< +<p>aaa</p> +<p>bbb</p> +>>> Paragraphs - 186 + aaa + bbb +<<< +<p> aaa + bbb</p> +>>> Paragraphs - 187 +aaa + bbb + ccc +<<< +<p>aaa + bbb + ccc</p> +>>> Paragraphs - 188 + aaa +bbb +<<< +<p> aaa +bbb</p> +>>> Paragraphs - 189 + aaa +bbb +<<< +<pre><code>aaa +</code></pre> +<p>bbb</p> +>>> Paragraphs - 190 +aaa +bbb +<<< +<p>aaa<br /> +bbb </p>
diff --git a/pkgs/markdown/test/gfm/precedence.unit b/pkgs/markdown/test/gfm/precedence.unit new file mode 100644 index 0000000..e91d5c7 --- /dev/null +++ b/pkgs/markdown/test/gfm/precedence.unit
@@ -0,0 +1,5 @@ +>>> Precedence - 12 +- `one +- two` +<<< +<ul><li>`one</li><li>two`</li></ul>
diff --git a/pkgs/markdown/test/gfm/raw_html.unit b/pkgs/markdown/test/gfm/raw_html.unit new file mode 100644 index 0000000..9228b6c --- /dev/null +++ b/pkgs/markdown/test/gfm/raw_html.unit
@@ -0,0 +1,99 @@ +>>> Raw HTML - 615 +<a><bab><c2c> +<<< +<p><a><bab><c2c></p> +>>> Raw HTML - 616 +<a/><b2/> +<<< +<p><a/><b2/></p> +>>> Raw HTML - 617 +<a /><b2 +data="foo" > +<<< +<p><a /><b2 +data="foo" ></p> +>>> Raw HTML - 618 +<a foo="bar" bam = 'baz <em>"</em>' +_boolean zoop:33=zoop:33 /> +<<< +<p><a foo="bar" bam = 'baz <em>"</em>' +_boolean zoop:33=zoop:33 /></p> +>>> Raw HTML - 619 +Foo <responsive-image src="foo.jpg" /> +<<< +<p>Foo <responsive-image src="foo.jpg" /></p> +>>> Raw HTML - 620 +<33> <__> +<<< +<p><33> <__></p> +>>> Raw HTML - 621 +<a h*#ref="hi"> +<<< +<a h*#ref="hi"> +>>> Raw HTML - 622 +<a href="hi'> <a href=hi'> +<<< +<p><a href="hi'> <a href=hi'></p> +>>> Raw HTML - 623 +< a>< +foo><bar/ > +<foo bar=baz +bim!bop /> +<<< +<p>< a>< +foo><bar/ > +<foo bar=baz +bim!bop /></p> +>>> Raw HTML - 624 +<a href='bar'title=title> +<<< +<a href='bar'title=title> +>>> Raw HTML - 625 +</a></foo > +<<< +<p></a></foo ></p> +>>> Raw HTML - 626 +</a href="foo"> +<<< +</a href="foo"> +>>> Raw HTML - 627 +foo <!-- this is a +comment - with hyphen --> +<<< +<p>foo <!-- this is a +comment - with hyphen --></p> +>>> Raw HTML - 628 +foo <!-- not a comment -- two hyphens --> +<<< +<p>foo <!-- not a comment -- two hyphens --></p> +>>> Raw HTML - 629 +foo <!--> foo --> + +foo <!-- foo---> +<<< +<p>foo <!--> foo --></p> +<p>foo <!-- foo---></p> +>>> Raw HTML - 630 +foo <?php echo $a; ?> +<<< +<p>foo <?php echo $a; ?></p> +>>> Raw HTML - 631 +foo <!ELEMENT br EMPTY> +<<< +<p>foo <!ELEMENT br EMPTY></p> +>>> Raw HTML - 632 +foo <![CDATA[>&<]]> +<<< +<p>foo <![CDATA[>&<]]></p> +>>> Raw HTML - 633 +foo <a href="ö"> +<<< +<p>foo <a href="ö"></p> +>>> Raw HTML - 634 +foo <a href="\*"> +<<< +<p>foo <a href="\*"></p> +>>> Raw HTML - 635 +<a href="\""> +<<< +<a href="\"">
diff --git a/pkgs/markdown/test/gfm/setext_headings.unit b/pkgs/markdown/test/gfm/setext_headings.unit new file mode 100644 index 0000000..206fc6e --- /dev/null +++ b/pkgs/markdown/test/gfm/setext_headings.unit
@@ -0,0 +1,214 @@ +>>> Setext headings - 50 +Foo *bar* +========= + +Foo *bar* +--------- +<<< +<h1>Foo <em>bar</em></h1> +<h2>Foo <em>bar</em></h2> +>>> Setext headings - 51 +Foo *bar +baz* +==== +<<< +<h1>Foo <em>bar +baz</em></h1> +>>> Setext headings - 52 +Foo +------------------------- + +Foo += +<<< +<h2>Foo</h2> +<h1>Foo</h1> +>>> Setext headings - 53 + Foo +--- + + Foo +----- + + Foo + === +<<< +<h2> Foo</h2> +<h2> Foo</h2> +<h1> Foo</h1> +>>> Setext headings - 54 + Foo + --- + + Foo +--- +<<< +<pre><code>Foo +--- + +Foo +</code></pre> +<hr /> +>>> Setext headings - 55 +Foo + ---- +<<< +<h2>Foo</h2> +>>> Setext headings - 56 +Foo + --- +<<< +<p>Foo + ---</p> +>>> Setext headings - 57 +Foo += = + +Foo +--- - +<<< +<p>Foo += =</p> +<p>Foo</p> +<hr /> +>>> Setext headings - 58 +Foo +----- +<<< +<h2>Foo </h2> +>>> Setext headings - 59 +Foo\ +---- +<<< +<h2>Foo\</h2> +>>> Setext headings - 60 +`Foo +---- +` + +<a title="a lot +--- +of dashes"/> +<<< +<h2>`Foo</h2> +<p>`</p> +<h2><a title="a lot</h2> +<p>of dashes"/></p> +>>> Setext headings - 61 +> Foo +--- +<<< +<blockquote> +<p>Foo</p></blockquote> +<hr /> +>>> Setext headings - 62 +> foo +bar +=== +<<< +<blockquote> +<p>foo</p></blockquote> +<h1>bar</h1> +>>> Setext headings - 63 +- Foo +--- +<<< +<ul><li>Foo</li></ul> +<hr /> +>>> Setext headings - 64 +Foo +Bar +--- +<<< +<h2>Foo +Bar</h2> +>>> Setext headings - 65 +--- +Foo +--- +Bar +--- +Baz +<<< +<hr /> +<h2>Foo</h2> +<h2>Bar</h2> +<p>Baz</p> +>>> Setext headings - 66 + +==== +<<< +<p>====</p> +>>> Setext headings - 67 +--- +--- +<<< +<hr /> +<hr /> +>>> Setext headings - 68 +- foo +----- +<<< +<ul><li>foo</li></ul> +<hr /> +>>> Setext headings - 69 + foo +--- +<<< +<pre><code>foo +</code></pre> +<hr /> +>>> Setext headings - 70 +> foo +----- +<<< +<blockquote> +<p>foo</p></blockquote> +<hr /> +>>> Setext headings - 71 +\> foo +------ +<<< +<h2>> foo</h2> +>>> Setext headings - 72 +Foo + +bar +--- +baz +<<< +<p>Foo</p> +<h2>bar</h2> +<p>baz</p> +>>> Setext headings - 73 +Foo +bar + +--- + +baz +<<< +<p>Foo +bar</p> +<hr /> +<p>baz</p> +>>> Setext headings - 74 +Foo +bar +* * * +baz +<<< +<p>Foo +bar</p> +<hr /> +<p>baz</p> +>>> Setext headings - 75 +Foo +bar +\--- +baz +<<< +<p>Foo +bar +--- +baz</p>
diff --git a/pkgs/markdown/test/gfm/soft_line_breaks.unit b/pkgs/markdown/test/gfm/soft_line_breaks.unit new file mode 100644 index 0000000..8ebfe99 --- /dev/null +++ b/pkgs/markdown/test/gfm/soft_line_breaks.unit
@@ -0,0 +1,12 @@ +>>> Soft line breaks - 652 +foo +baz +<<< +<p>foo +baz</p> +>>> Soft line breaks - 653 +foo + baz +<<< +<p>foo + baz</p>
diff --git a/pkgs/markdown/test/gfm/strikethrough_extension.unit b/pkgs/markdown/test/gfm/strikethrough_extension.unit new file mode 100644 index 0000000..3c00ef8 --- /dev/null +++ b/pkgs/markdown/test/gfm/strikethrough_extension.unit
@@ -0,0 +1,11 @@ +>>> Strikethrough (extension) - 477 +~~Hi~~ Hello, world! +<<< +<p><del>Hi</del> Hello, world!</p> +>>> Strikethrough (extension) - 478 +This ~~has a + +new paragraph~~. +<<< +<p>This ~~has a</p> +<p>new paragraph~~.</p>
diff --git a/pkgs/markdown/test/gfm/tables_extension.unit b/pkgs/markdown/test/gfm/tables_extension.unit new file mode 100644 index 0000000..bbec675 --- /dev/null +++ b/pkgs/markdown/test/gfm/tables_extension.unit
@@ -0,0 +1,57 @@ +>>> Tables (extension) - 192 +| foo | bar | +| --- | --- | +| baz | bim | +<<< +<table><thead><tr><th>foo</th><th>bar</th></tr></thead><tbody><tr><td>baz</td><td>bim</td></tr></tbody></table> +>>> Tables (extension) - 193 +| abc | defghi | +:-: | -----------: +bar | baz +<<< +<table><thead><tr><th style="text-align: center;">abc</th><th style="text-align: right;">defghi</th></tr></thead><tbody><tr><td style="text-align: center;">bar</td><td style="text-align: right;">baz</td></tr></tbody></table> +>>> Tables (extension) - 194 +| f\|oo | +| ------ | +| b `\|` az | +| b **\|** im | +<<< +<table><thead><tr><th>f|oo</th></tr></thead><tbody><tr><td>b <code>|</code> az</td></tr><tr><td>b <strong>|</strong> im</td></tr></tbody></table> +>>> Tables (extension) - 195 +| abc | def | +| --- | --- | +| bar | baz | +> bar +<<< +<table><thead><tr><th>abc</th><th>def</th></tr></thead><tbody><tr><td>bar</td><td>baz</td></tr></tbody></table> +<blockquote> +<p>bar</p></blockquote> +>>> Tables (extension) - 196 +| abc | def | +| --- | --- | +| bar | baz | +bar + +bar +<<< +<table><thead><tr><th>abc</th><th>def</th></tr></thead><tbody><tr><td>bar</td><td>baz</td></tr><tr><td>bar</td><td /></tr></tbody></table> +<p>bar</p> +>>> Tables (extension) - 197 +| abc | def | +| --- | +| bar | +<<< +<p>| --- | +| bar |</p> +>>> Tables (extension) - 198 +| abc | def | +| --- | --- | +| bar | +| bar | baz | boo | +<<< +<table><thead><tr><th>abc</th><th>def</th></tr></thead><tbody><tr><td>bar</td><td /></tr><tr><td>bar</td><td>baz</td></tr></tbody></table> +>>> Tables (extension) - 199 +| abc | def | +| --- | --- | +<<< +<table><thead><tr><th>abc</th><th>def</th></tr></thead></table>
diff --git a/pkgs/markdown/test/gfm/tabs.unit b/pkgs/markdown/test/gfm/tabs.unit new file mode 100644 index 0000000..97804f6 --- /dev/null +++ b/pkgs/markdown/test/gfm/tabs.unit
@@ -0,0 +1,67 @@ +>>> Tabs - 1 + foo baz bim +<<< +<pre><code>foo baz bim +</code></pre> +>>> Tabs - 2 + foo baz bim +<<< +<pre><code>foo baz bim +</code></pre> +>>> Tabs - 3 + a a + ὐ a +<<< +<pre><code>a a +ὐ a +</code></pre> +>>> Tabs - 4 + - foo + + bar +<<< +<ul><li> +<p>foo</p> +<p>bar</p></li></ul> +>>> Tabs - 5 +- foo + + bar +<<< +<ul><li> +<p>foo</p> +<pre><code> bar +</code></pre></li></ul> +>>> Tabs - 6 +> foo +<<< +<blockquote> +<pre><code> foo +</code></pre></blockquote> +>>> Tabs - 7 +- foo +<<< +<ul><li> +<pre><code>foo +</code></pre></li></ul> +>>> Tabs - 8 + foo + bar +<<< +<pre><code>foo +bar +</code></pre> +>>> Tabs - 9 + - foo + - bar + - baz +<<< +<ul><li>foo<ul><li>bar<ul><li>baz</li></ul></li></ul></li></ul> +>>> Tabs - 10 +# Foo +<<< +<h1>Foo</h1> +>>> Tabs - 11 +* * * +<<< +<hr />
diff --git a/pkgs/markdown/test/gfm/textual_content.unit b/pkgs/markdown/test/gfm/textual_content.unit new file mode 100644 index 0000000..afa8a53 --- /dev/null +++ b/pkgs/markdown/test/gfm/textual_content.unit
@@ -0,0 +1,12 @@ +>>> Textual content - 654 +hello $.;'there +<<< +<p>hello $.;'there</p> +>>> Textual content - 655 +Foo χρῆν +<<< +<p>Foo χρῆν</p> +>>> Textual content - 656 +Multiple spaces +<<< +<p>Multiple spaces</p>
diff --git a/pkgs/markdown/test/gfm/thematic_breaks.unit b/pkgs/markdown/test/gfm/thematic_breaks.unit new file mode 100644 index 0000000..ed9fc50 --- /dev/null +++ b/pkgs/markdown/test/gfm/thematic_breaks.unit
@@ -0,0 +1,112 @@ +>>> Thematic breaks - 13 +*** +--- +___ +<<< +<hr /> +<hr /> +<hr /> +>>> Thematic breaks - 14 ++++ +<<< +<p>+++</p> +>>> Thematic breaks - 15 +=== +<<< +<p>===</p> +>>> Thematic breaks - 16 +-- +** +__ +<<< +<p>-- +** +__</p> +>>> Thematic breaks - 17 + *** + *** + *** +<<< +<hr /> +<hr /> +<hr /> +>>> Thematic breaks - 18 + *** +<<< +<pre><code>*** +</code></pre> +>>> Thematic breaks - 19 +Foo + *** +<<< +<p>Foo + ***</p> +>>> Thematic breaks - 20 +_____________________________________ +<<< +<hr /> +>>> Thematic breaks - 21 + - - - +<<< +<hr /> +>>> Thematic breaks - 22 + ** * ** * ** * ** +<<< +<hr /> +>>> Thematic breaks - 23 +- - - - +<<< +<hr /> +>>> Thematic breaks - 24 +- - - - +<<< +<hr /> +>>> Thematic breaks - 25 +_ _ _ _ a + +a------ + +---a--- +<<< +<p>_ _ _ _ a</p> +<p>a------</p> +<p>---a---</p> +>>> Thematic breaks - 26 + *-* +<<< +<p> <em>-</em></p> +>>> Thematic breaks - 27 +- foo +*** +- bar +<<< +<ul><li>foo</li></ul> +<hr /><ul><li>bar</li></ul> +>>> Thematic breaks - 28 +Foo +*** +bar +<<< +<p>Foo</p> +<hr /> +<p>bar</p> +>>> Thematic breaks - 29 +Foo +--- +bar +<<< +<h2>Foo</h2> +<p>bar</p> +>>> Thematic breaks - 30 +* Foo +* * * +* Bar +<<< +<ul><li>Foo</li></ul> +<hr /><ul><li>Bar</li></ul> +>>> Thematic breaks - 31 +- Foo +- * * * +<<< +<ul><li>Foo</li><li> +<hr /></li></ul>
diff --git a/pkgs/markdown/test/markdown_test.dart b/pkgs/markdown/test/markdown_test.dart index 6cfd500..d88b91b 100644 --- a/pkgs/markdown/test/markdown_test.dart +++ b/pkgs/markdown/test/markdown_test.dart
@@ -23,6 +23,9 @@ testFile('extensions/emojis.unit', inlineSyntaxes: [EmojiSyntax()]); testFile('extensions/inline_html.unit', inlineSyntaxes: [InlineHtmlSyntax()]); + testDirectory('common_mark'); + testDirectory('gfm', extensionSet: ExtensionSet.gitHubFlavored); + group('Corner cases', () { validateCore('Incorrect Links', ''' 5 Ethernet ([Music](
diff --git a/pkgs/markdown/test/util.dart b/pkgs/markdown/test/util.dart index af84655..7d011de 100644 --- a/pkgs/markdown/test/util.dart +++ b/pkgs/markdown/test/util.dart
@@ -8,17 +8,26 @@ import 'dart:mirrors'; import 'package:expected_output/expected_output.dart'; +import 'package:io/ansi.dart' as ansi; import 'package:markdown/markdown.dart'; import 'package:path/path.dart' as p; import 'package:test/test.dart'; /// Run tests defined in "*.unit" files inside directory [name]. -void testDirectory(String name) { +void testDirectory( + String name, { + ExtensionSet extensionSet, +}) { for (var dataCase in dataCasesUnder(library: #markdown.test.util, subdirectory: name)) { var description = '${dataCase.directory}/${dataCase.file}.unit ${dataCase.description}'; - validateCore(description, dataCase.input, dataCase.expectedOutput); + validateCore( + description, + dataCase.input, + dataCase.expectedOutput, + extensionSet: extensionSet, + ); } } @@ -38,20 +47,48 @@ } } -void validateCore(String description, String markdown, String html, - {Iterable<BlockSyntax> blockSyntaxes, - Iterable<InlineSyntax> inlineSyntaxes, - Resolver linkResolver, - Resolver imageLinkResolver, - bool inlineOnly = false}) { +void validateCore( + String description, + String markdown, + String html, { + Iterable<BlockSyntax> blockSyntaxes, + Iterable<InlineSyntax> inlineSyntaxes, + Resolver linkResolver, + Resolver imageLinkResolver, + ExtensionSet extensionSet, + bool inlineOnly = false, +}) { test(description, () { var result = markdownToHtml(markdown, blockSyntaxes: blockSyntaxes, inlineSyntaxes: inlineSyntaxes, + extensionSet: extensionSet, linkResolver: linkResolver, imageLinkResolver: imageLinkResolver, inlineOnly: inlineOnly); + markdownPrintOnFailure(markdown, html, result); + expect(result, html); }); } + +String whitespaceColor(String input) => input + .replaceAll(' ', ansi.lightBlue.wrap('·')) + .replaceAll('\t', ansi.backgroundDarkGray.wrap('\t')); + +void markdownPrintOnFailure(String markdown, String expected, String actual) { + printOnFailure(""" +INPUT: +'''r +${whitespaceColor(markdown)}''' + +EXPECTED: +'''r +${whitespaceColor(expected)}''' + +GOT: +'''r +${whitespaceColor(actual)}''' +"""); +}
diff --git a/pkgs/markdown/tool/stats.dart b/pkgs/markdown/tool/stats.dart index 3b2a5ff..d6cf240 100644 --- a/pkgs/markdown/tool/stats.dart +++ b/pkgs/markdown/tool/stats.dart
@@ -5,6 +5,7 @@ import 'package:args/args.dart'; import 'package:collection/collection.dart'; +import 'package:expected_output/expected_output.dart'; import 'package:path/path.dart' as p; import 'stats_lib.dart'; @@ -76,6 +77,13 @@ } } +final _sectionNameReplace = RegExp('[ \\)\\(]+'); + +String _unitOutput(Iterable<DataCase> cases) => cases.map((dataCase) => ''' +>>> ${dataCase.front_matter} +${dataCase.input}<<< +${dataCase.expectedOutput}''').join(); + Future<void> _processConfig( String testPrefix, bool raw, @@ -95,12 +103,34 @@ if (specifiedSection != null && entry.key != specifiedSection) { return; } + + final units = <DataCase>[]; + for (var e in entry.value) { + final result = compareResult(config, e, + verboseFail: verbose, verboseLooseMatch: verboseLooseMatch); + + units.add(DataCase( + front_matter: result.testCase.toString(), + input: result.testCase.markdown, + expectedOutput: result.result, + )); + var nestedMap = scores.putIfAbsent( entry.key, () => SplayTreeMap<int, CompareLevel>()); + nestedMap[e.example] = result.compareLevel; + } - nestedMap[e.example] = compareResult(config, e, - verboseFail: verbose, verboseLooseMatch: verboseLooseMatch); + if (updateFiles && units.isNotEmpty) { + var fileName = + entry.key.toLowerCase().replaceAll(_sectionNameReplace, '_'); + while (fileName.endsWith('_')) { + fileName = fileName.substring(0, fileName.length - 1); + } + fileName = '$fileName.unit'; + File(p.join('test', testPrefix, fileName)) + ..createSync(recursive: true) + ..writeAsStringSync(_unitOutput(units)); } }
diff --git a/pkgs/markdown/tool/stats_lib.dart b/pkgs/markdown/tool/stats_lib.dart index 2460dd8..4d5d68b 100644 --- a/pkgs/markdown/tool/stats_lib.dart +++ b/pkgs/markdown/tool/stats_lib.dart
@@ -11,6 +11,8 @@ import 'package:markdown/markdown.dart' show markdownToHtml, ExtensionSet; import 'package:path/path.dart' as p; +import '../test/util.dart'; + // Locate the "tool" directory. Use mirrors so that this works with the test // package, which loads this suite into an isolate. String get toolDir => @@ -78,11 +80,22 @@ json['markdown'] as String, json['html'] as String); } + + @override + String toString() => '$section - $example'; } enum CompareLevel { strict, loose, fail, error } -CompareLevel compareResult(Config config, CommonMarkTestCase testCase, +class CompareResult { + final CompareLevel compareLevel; + final CommonMarkTestCase testCase; + final String result; + + CompareResult(this.testCase, this.result, this.compareLevel); +} + +CompareResult compareResult(Config config, CommonMarkTestCase testCase, {bool throwOnError = false, bool verboseFail = false, bool verboseLooseMatch = false}) { @@ -99,11 +112,11 @@ config.baseUrl, 'ERROR', testCase, 'Thrown: $err\n$stackTrace'); } - return CompareLevel.error; + return CompareResult(testCase, null, CompareLevel.error); } if (testCase.html == output) { - return CompareLevel.strict; + return CompareResult(testCase, output, CompareLevel.strict); } var expectedParsed = parseFragment(testCase.html); @@ -119,10 +132,12 @@ _printVerboseFailure(config.baseUrl, 'LOOSE', testCase, output); } - return looseMatch ? CompareLevel.loose : CompareLevel.fail; + return CompareResult( + testCase, output, looseMatch ? CompareLevel.loose : CompareLevel.fail); } -String _indent(String s) => s.splitMapJoin('\n', onNonMatch: (n) => ' $n'); +String _indent(String s) => + s.splitMapJoin('\n', onNonMatch: (n) => ' ${whitespaceColor(n)}'); void _printVerboseFailure(String baseUrl, String message, CommonMarkTestCase testCase, String actual) {