diff --git a/Makefile b/Makefile index 99a25db..6495f77 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ lint: test: lint NODE_ENV=test mocha -R spec + ./bin/specsplit.js test/fixtures/stmd/spec.txt gh-pages: diff --git a/test/fixtures/stmd/bad.txt b/test/fixtures/stmd/bad.txt new file mode 100644 index 0000000..8e75fcf --- /dev/null +++ b/test/fixtures/stmd/bad.txt @@ -0,0 +1,5210 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 205 + +. + foo baz bim +. +
foo baz bim
+
+.
+
+error:
+
+foo baz bim
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 212
+
+.
+ a a
+ ὐ a
+.
+a a
+ὐ a
+
+.
+
+error:
+
+a a
+ὐ a
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 241
+
+.
+- `one
+- two`
+.
+`one
two`
Foo +***
+. + +error: + +Foo + ***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 395 + +. + *-* +. +-
+. + +error: + +*-*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 403 + +. +- foo +*** +- bar +. +foo
bar
Foo
Bar
Foo
foo +# bar
+. + +error: + +foo
+# bar
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 680
+
+.
+Foo *bar*
+=========
+
+Foo *bar*
+---------
+.
+Foo +---
+. + +error: + +Foo + ---
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 776 + +. +Foo +----- +. +Foo +bar
+. + +error: + +Foo + bar
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1237 + +. +``` ``` +aaa +. +
+aaa
aaa
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1328
+
+.
+``` aa ```
+foo
+.
+aa
+foo
foo
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1373
+
+.
++ hi + | +
+ hi + | +
okay.
+. + +error: + +<table> + <tr> + <td> + hi + </td> + </tr> +</table>
+okay.
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1394 + +. +<div> + *hello* + <foo><a>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1406 + +. +Markdown
+<DIV CLASS="foo">
+*Markdown*
+</DIV>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1422 + +. + +``` c +int x = 33; +``` +. + +``` c +int x = 33; +``` +. + +error: + +<div></div>
+int x = 33;
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1436
+
+.
+
+.
+
+.
+
+error:
+
+<!-- Foo +bar + baz -->
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1448 + +. + +. + +. + +error: + +<?php + echo 'foo' +?>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1460 + +. + +. + +. + +error: + +<![CDATA[ +function matchwo(a,b) +{ +if (a < b && a < 0) then + { + return 1; + } +else + { + return 0; + } +} +]]>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1492 + +. + + + +. + +<!-- foo -->
+
+.
+
+error:
+
+<!-- foo -->
+<!-- foo -->
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1505
+
+.
+Foo
+Foo
+Foo +<div> +bar +</div>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1520 + +. +<div> +bar +</div> +*foo*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1534 + +. +Emphasized text.
+<div>
+*Emphasized* text.
+</div>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1584 + +. +<div> +*Emphasized* text. +</div>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1605 + +. ++Hi + | + +
+Hi + | +
<table>
+<tr>
+<td> +Hi +</td>
+</tr>
+</table>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1652 + +. +[foo]: /url "title" + +[foo] +. + +. + +error: + +[foo]: /url "title"
+[foo]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1660 + +. + [foo]: + /url + 'the title' + +[foo] +. + +. + +error: + +[foo]: + /url + 'the title'
+[foo]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1670 + +. +[Foo*bar\]]:my_(url) 'title (with parens)' + +[Foo*bar\]] +. + +. + +error: + +[Foo*bar]]:my_(url) 'title (with parens)'
+[Foo*bar]]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1678 + +. +[Foo bar]: +[Foo bar]: +<my url> +'title'
+[Foo bar]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1690 + +. +[foo]: +/url + +[foo] +. + +. + +error: + +[foo]: +/url
+[foo]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1712 + +. +[foo] + +[foo]: url +. + +. + +error: + +[foo]
+[foo]: url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1723 + +. +[foo] + +[foo]: first +[foo]: second +. + +. + +error: + +[foo]
+[foo]: first +[foo]: second
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1735 + +. +[FOO]: /url + +[Foo] +. + +. + +error: + +[FOO]: /url
+[Foo]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1743 + +. +[ΑΓΩ]: /φου + +[αγω] +. + +. + +error: + +[ΑΓΩ]: /φου
+[αγω]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1754 + +. +[foo]: /url +. +. + +error: + +[foo]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1813 + +. +# [Foo] +[foo]: /url +> bar +. +++. + +error: + +bar
+
[foo]: /url
+++ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1827 + +. +[foo]: /foo-url "foo" +[bar]: /bar-url + "bar" +[baz]: /baz-url + +[foo], +[bar], +[baz] +. + +. + +error: + +bar
+
[foo]: /foo-url "foo" +[bar]: /bar-url + "bar" +[baz]: /baz-url
+[foo], +[bar], +[baz]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1847 + +. +[foo] + +> [foo]: /url +. + +++. + +error: + +
[foo]
+++ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1907 + +. + aaa + bbb +. +[foo]: /url
+
aaa +bbb
+. + +error: + +aaa + bbb
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1918 + +. +aaa + bbb + ccc +. +aaa +bbb +ccc
+. + +error: + +aaa + bbb + ccc
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1931 + +. + aaa +bbb +. +aaa +bbb
+. + +error: + +aaa +bbb
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1952 + +. +aaa +bbb +. +aaa
+bbb
aaa +bbb
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2133 + +. +> - foo +- bar +. ++++
+- foo
+
+++
+- +
foo
bar
+++foo +
bar
+
+.
+
+error:
+
+++ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2159 + +. +> ``` +foo +``` +. ++foo +bar +
+++
foo
+
+.
+
+error:
+
++++foo +
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 2236
+
+.
+> foo
+>
+> bar
+.
+++. + +error: + +foo
+bar
+
++ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2350 + +. +> code + +> not code +. +foo
+
+++code +
++. + +error: + +not code
+
+++code +
++ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2414 + +. +1. A paragraph + with two lines. + + indented code + + > A block quote. +. +not code
+
A paragraph +with two lines.
+indented code
+
++A block quote.
+
A paragraph +with two lines.
two
+. + +error: + +one
two
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2466 + +. + - one + + two +. + two
+
+.
+
+error:
+
+one
+two
one
+two
one
+two
++. + +error: + ++++
+- one
+two
+
++ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2540 + +. +- foo + + bar + +- foo + + + bar + +- ``` + foo + + + bar + ``` +. ++++
+- +
one
two
+
foo
+bar
foo
bar
+foo
+
+
+bar
+
foo
+bar
foo
bar
+foo
+bar
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 2574
+
+.
+1. foo
+
+ ```
+ bar
+ ```
+
+ baz
+
+ > bam
+.
+foo
+bar
+
+baz
++bam
+
foo
+bar
+
+foo
+bar
+
foo
+bar
+foo
+bar
+
foo
+ bar
+indented code
+
+paragraph
+more code
+
indented code
indented code
+
+paragraph
+more code
+
indented code
foo
+bar
+. + +error: + +foo
+bar
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2707 + +. +- foo + + bar +. +bar
+. + +error: + +foo
bar
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2743 + +. + 1. A paragraph + with two lines. + + indented code + + > A block quote. +. +A paragraph +with two lines.
+indented code
+
++A block quote.
+
A paragraph + with two lines.
A paragraph +with two lines.
+indented code
+
++A block quote.
+
A paragraph + with two lines.
A paragraph +with two lines.
+indented code
+
++A block quote.
+
A paragraph + with two lines.
A paragraph +with two lines.
+indented code
+
++A block quote.
+
A paragraph +with two lines.
A paragraph +with two lines.
foo
+bar
baz
foo
bar
baz
foo
+bar
foo
bar
foo
foo
foo
bar
foo
bar
baz
foo
bar
baz
foo
bar
foo
bar
baz
bar
+foo
bar
+baz
bim
+
+.
+
+error:
+
+foo
+bar
baz
bim
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3318
+
+.
+- foo
+- bar
+
+
+- baz
+- bim
+.
+foo
bar
baz
bim
foo
+notcode
foo
code
+
+.
+
+error:
+
+foo
+notcode
foo
code
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3360
+
+.
+- a
+ - b
+ - c
+ - d
+ - e
+ - f
+- g
+.
+a
b
c
d
e
f
g
a
b
c
a
b
c
a
c
a
c
a
b
+c
d
a
b
c
+d
a
b
d
a
b
[ref]: /url
+d
b
+
+
+
a
b
+- c
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3469
+
+.
+- a
+ - b
+
+ c
+- d
+.
+b
+c
a
+b
c
d
+b
+
a
++b
+
c
++b
+
c
+
a
+++b
+
c
+
+d
a
a
+b
foo
+baz
foo
+bar
baz
a
+d
+a
+b
c
d
e
f
hi
lo`
`hi`lo`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3616 + +. +\ \A\a\ \3\φ\« +. +\ \A\a\ \3\φ\«
+. + +error: + +\ \A\a\ \3\φ\«
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3647 + +. +\\*emphasis* +. +\emphasis
+. + +error: + +\*emphasis*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3655 + +. +foo\ +bar +. +foo
+bar
foo\ +bar
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3666 + +. +`` \[\` `` +. +\[\`
`` [` ``
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3688 + +. +<http://google.com?find=*>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3694 + +. + +. + +. + +error: + +<a href="/bar/)">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3704 + +. +[foo](/bar\* "ti\*tle") +. + +. + +error: + +[foo](/bar* "ti*tle")
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3710 + +. +[foo] + +[foo]: /bar\* "ti\*tle" +. + +. + +error: + +[foo]
+[foo]: /bar* "ti*tle"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3718 + +. +``` foo\+bar +foo +``` +. +foo
+
+.
+
+error:
+
+foo
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3736
+
+.
+ & © Æ Ď ¾ ℋ ⅆ ∲
+.
+& © Æ Ď ¾ ℋ ⅆ ∲
+. + +error: + + & © Æ Ď ¾ ℋ ⅆ ∲
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3745 + +. + # Ӓ Ϡ +. +# Ӓ Ϡ
+. + +error: + + # Ӓ Ϡ �
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3755 + +. + " ആ ಫ +. +" ആ ಫ
+. + +error: + + " ആ ಫ
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3781 + +. +&MadeUpEntity; +. +&MadeUpEntity;
+. + +error: + +&MadeUpEntity;
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3791 + +. + +. + +. + +error: + +<a href="öö.html">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3797 + +. +[foo](/föö "föö") +. + +. + +error: + +[foo](/föö "föö")
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3803 + +. +[foo] + +[foo]: /föö "föö" +. + +. + +error: + +[foo]
+[foo]: /föö "föö"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3811 + +. +``` föö +foo +``` +. +foo
+
+.
+
+error:
+
+foo
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3822
+
+.
+`föö`
+.
+föö
`föö`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3849 + +. +`foo` +. +foo
`foo`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3858 + +. +`` foo ` bar `` +. +foo ` bar
`` foo ` bar ``
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3867 + +. +` `` ` +. +``
` `` `
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3875 + +. +`` +foo +`` +. +foo
`` +foo +``
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3886 + +. +`foo bar + baz` +. +foo bar baz
`foo bar + baz`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3906 + +. +`foo `` bar` +. +foo `` bar
`foo `` bar`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3915 + +. +`foo\`bar` +. +foo\
bar`
`foo`bar`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3930 + +. +*foo`*` +. +*foo*
*foo`*`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3938 + +. +[not a `link](/foo`) +. +[not a link](/foo
)
[not a `link](/foo`)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3946 + +. +<http://foo.bar.`baz>`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3954 + +. +` +. + +. + +error: + +<a href="`">`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3963 + +. +```foo`` +. +```foo``
+. + +error: + +
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 4095
+
+.
+*foo bar*
+.
+foo bar
+. + +error: + +*foo bar*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4101 + +. +_foo bar_ +. +foo bar
+. + +error: + +_foo bar_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4109 + +. +**foo bar** +. +foo bar
+. + +error: + +**foo bar**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4115 + +. +__foo bar__ +. +foo bar
+. + +error: + +__foo bar__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4123 + +. +*foo +bar* +. +foo +bar
+. + +error: + +*foo +bar*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4131 + +. +_foo +bar_ +. +foo +bar
+. + +error: + +_foo +bar_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4139 + +. +**foo +bar** +. +foo +bar
+. + +error: + +**foo +bar**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4147 + +. +__foo +bar__ +. +foo +bar
+. + +error: + +__foo +bar__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4157 + +. +*foo [bar](/url)* +. +foo bar
+. + +error: + +*foo [bar](/url)*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4163 + +. +_foo [bar](/url)_ +. +foo bar
+. + +error: + +_foo [bar](/url)_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4169 + +. +**foo [bar](/url)** +. +foo bar
+. + +error: + +**foo [bar](/url)**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4175 + +. +__foo [bar](/url)__ +. +foo bar
+. + +error: + +__foo [bar](/url)__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4184 + +. +*foo [bar*](/url) +. +*foo bar*
+. + +error: + +*foo [bar*](/url)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4190 + +. +_foo [bar_](/url) +. +_foo bar_
+. + +error: + +_foo [bar_](/url)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4196 + +. +** +. + +. + +error: + +**<a href="**">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4202 + +. +__ +. + +. + +error: + +__<a href="__">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4208 + +. +*a `*`* +. +a *
*a `*`*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4214 + +. +_a `_`_ +. +a _
_a `_`_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4220 + +. +**a**a<http://foo.bar?q=**>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4226 + +. +__a__a<http://foo.bar?q=__>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4325 + +. +*here is a \** +. +here is a *
+. + +error: + +*here is a **
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4331 + +. +__this is a double underscore (`__`)__ +. +this is a double underscore (__
)
__this is a double underscore (`__`)__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4339 + +. +foo*bar*baz +. +foobarbaz
+. + +error: + +foo*bar*baz
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4357 + +. +_foo_bar_baz_ +. +foo_bar_baz
+. + +error: + +_foo_bar_baz_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4363 + +. +11*15*32 +. +111532
+. + +error: + +11*15*32
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4378 + +. +_foo_bar_baz_ +. +foo_bar_baz
+. + +error: + +_foo_bar_baz_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4384 + +. +__foo__bar__baz__ +. +foo__bar__baz
+. + +error: + +__foo__bar__baz__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4392 + +. +***foo bar*** +. +foo bar
+. + +error: + +***foo bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4398 + +. +___foo bar___ +. +foo bar
+. + +error: + +___foo bar___
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4404 + +. +***foo** bar* +. +foo bar
+. + +error: + +***foo** bar*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4410 + +. +___foo__ bar_ +. +foo bar
+. + +error: + +___foo__ bar_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4416 + +. +***foo* bar** +. +foo bar
+. + +error: + +***foo* bar**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4422 + +. +___foo_ bar__ +. +foo bar
+. + +error: + +___foo_ bar__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4428 + +. +*foo **bar*** +. +foo bar
+. + +error: + +*foo **bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4434 + +. +_foo __bar___ +. +foo bar
+. + +error: + +_foo __bar___
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4440 + +. +**foo *bar*** +. +foo bar
+. + +error: + +**foo *bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4446 + +. +__foo _bar___ +. +foo bar
+. + +error: + +__foo _bar___
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4452 + +. +*foo **bar*** +. +foo bar
+. + +error: + +*foo **bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4458 + +. +_foo __bar___ +. +foo bar
+. + +error: + +_foo __bar___
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4464 + +. +*foo *bar* baz* +. +foo bar baz
+. + +error: + +*foo *bar* baz*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4470 + +. +_foo _bar_ baz_ +. +foo bar baz
+. + +error: + +_foo _bar_ baz_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4476 + +. +**foo **bar** baz** +. +foo bar baz
+. + +error: + +**foo **bar** baz**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4482 + +. +__foo __bar__ baz__ +. +foo bar baz
+. + +error: + +__foo __bar__ baz__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4488 + +. +*foo **bar** baz* +. +foo bar baz
+. + +error: + +*foo **bar** baz*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4494 + +. +_foo __bar__ baz_ +. +foo bar baz
+. + +error: + +_foo __bar__ baz_
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4500 + +. +**foo *bar* baz** +. +foo bar baz
+. + +error: + +**foo *bar* baz**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4506 + +. +__foo _bar_ baz__ +. +foo bar baz
+. + +error: + +__foo _bar_ baz__
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4516 + +. +**foo** +. +foo
+. + +error: + +**foo**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4530 + +. +*_foo_* +. +foo
+. + +error: + +*_foo_*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4536 + +. +**__foo__** +. +foo
+. + +error: + +**__foo__**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4546 + +. +*foo** +. +foo*
+. + +error: + +*foo**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4552 + +. +*foo *bar** +. +foo bar
+. + +error: + +*foo *bar**
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4558 + +. +**foo*** +. +foo*
+. + +error: + +**foo***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4564 + +. +***foo* bar*** +. +foo bar*
+. + +error: + +***foo* bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4570 + +. +***foo** bar*** +. +foo bar**
+. + +error: + +***foo** bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4579 + +. +*foo**bar*** +. +foobar**
+. + +error: + +*foo**bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4595 + +. +*foo** + +**foo* +. +foo*
+**foo*
+. + +error: + +*foo**
+**foo*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4604 + +. +*foo *bar** + +**foo* bar* +. +foo bar
+**foo* bar*
+. + +error: + +*foo *bar**
+**foo* bar*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4621 + +. +*bar*** +. +bar**
+. + +error: + +*bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4633 + +. +**bar*** +. +bar*
+. + +error: + +**bar***
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4645 + +. +***foo *bar* +. +***foo bar
+. + +error: + +***foo *bar*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4717 + +. +[link](/uri "title") +. + +. + +error: + +[link](/uri "title")
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4725 + +. +[link](/uri) +. + +. + +error: + +[link](/uri)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4733 + +. +[link]() +. + +. + +error: + +[link]()
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4739 + +. +[link](<>) +. + +. + +error: + +[link](<>)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4755 + +. +[link]([link](</my uri>)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4773 + +. +[link]((foo)and(bar)) +. + +. + +error: + +[link]((foo)and(bar))
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4788 + +. +[link](foo(and\(bar\))) +. + +. + +error: + +[link](foo(and(bar)))
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4794 + +. +[link]([link](<foo(and(bar))>)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4803 + +. +[link](foo\)\:) +. + +. + +error: + +[link](foo):)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4811 + +. +[link](foo%20bä) +. + +. + +error: + +[link](foo%20bä)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4821 + +. +[link]("title") +. + +. + +error: + +[link]("title")
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4829 + +. +[link](/url "title") +[link](/url 'title') +[link](/url (title)) +. + +. + +error: + +[link](/url "title") +[link](/url 'title') +[link](/url (title))
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4841 + +. +[link](/url "title \""") +. + +. + +error: + +[link](/url "title """)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4857 + +. +[link](/url 'title "and" title') +. + +. + +error: + +[link](/url 'title "and" title')
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4879 + +. +[link]( /uri + "title" ) +. + +. + +error: + +[link]( /uri + "title" )
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4898 + +. +[foo[foo
[foo <bar attr="](baz)">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4927 + +. +[foo][bar] + +[bar]: /url "title" +. + +. + +error: + +[foo][bar]
+[bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4937 + +. +[*foo\!*][bar] + +[bar]: /url "title" +. + +. + +error: + +[*foo!*][bar]
+[bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4947 + +. +[foo][BaR] + +[bar]: /url "title" +. + +. + +error: + +[foo][BaR]
+[bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4957 + +. +[Толпой][Толпой] is a Russian word. + +[ТОЛПОЙ]: /url +. +Толпой is a Russian word.
+. + +error: + +[Толпой][Толпой] is a Russian word.
+[ТОЛПОЙ]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4968 + +. +[Foo + bar]: /url + +[Baz][Foo bar] +. + +. + +error: + +[Foo + bar]: /url
+[Baz][Foo bar]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4979 + +. +[foo] [bar] + +[bar]: /url "title" +. + +. + +error: + +[foo] [bar]
+[bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4987 + +. +[foo] +[bar] + +[bar]: /url "title" +. + +. + +error: + +[foo] +[bar]
+[bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4999 + +. +[foo]: /url1 + +[foo]: /url2 + +[bar][foo] +. + +. + +error: + +[foo]: /url1
+[foo]: /url2
+[bar][foo]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5013 + +. +[bar][foo\!] + +[foo!]: /url +. +[bar][foo!]
+. + +error: + +[bar][foo!]
+[foo!]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5030 + +. +[foo][] + +[foo]: /url "title" +. + +. + +error: + +[foo][]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5038 + +. +[*foo* bar][] + +[*foo* bar]: /url "title" +. + +. + +error: + +[*foo* bar][]
+[*foo* bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5048 + +. +[Foo][] + +[foo]: /url "title" +. + +. + +error: + +[Foo][]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5060 + +. +[foo] +[] + +[foo]: /url "title" +. + +. + +error: + +[foo] +[]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5079 + +. +[foo] + +[foo]: /url "title" +. + +. + +error: + +[foo]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5087 + +. +[*foo* bar] + +[*foo* bar]: /url "title" +. + +. + +error: + +[*foo* bar]
+[*foo* bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5095 + +. +[[*foo* bar]] + +[*foo* bar]: /url "title" +. +[foo bar]
+. + +error: + +[[*foo* bar]]
+[*foo* bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5105 + +. +[Foo] + +[foo]: /url "title" +. + +. + +error: + +[Foo]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5116 + +. +\[foo] + +[foo]: /url "title" +. +[foo]
+. + +error: + +[foo]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5127 + +. +[foo*]: /url + +*[foo*] +. +*foo*
+. + +error: + +[foo*]: /url
+*[foo*]
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5138 + +. +[foo`]: /url + +[foo`]` +. +[foo]
[foo`]: /url
+[foo`]`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5148 + +. +[[[foo]]] + +[[[foo]]]: /url +. + +. + +error: + +[[[foo]]]
+[[[foo]]]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5156 + +. +[[[foo]]] + +[[[foo]]]: /url1 +[foo]: /url2 +. + +. + +error: + +[[[foo]]]
+[[[foo]]]: /url1 +[foo]: /url2
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5167 + +. +[\[foo] + +[\[foo]: /url +. + +. + +error: + +[[foo]
+[[foo]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5177 + +. +[foo][bar] + +[foo]: /url1 +[bar]: /url2 +. + +. + +error: + +[foo][bar]
+[foo]: /url1 +[bar]: /url2
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5189 + +. +[foo][bar][baz] + +[baz]: /url +. +[foo]bar
+. + +error: + +[foo][bar][baz]
+[baz]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5200 + +. +[foo][bar][baz] + +[baz]: /url1 +[bar]: /url2 +. + +. + +error: + +[foo][bar][baz]
+[baz]: /url1 +[bar]: /url2
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5212 + +. +[foo][bar][baz] + +[baz]: /url1 +[foo]: /url2 +. +[foo]bar
+. + +error: + +[foo][bar][baz]
+[baz]: /url1 +[foo]: /url2
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5229 + +. +![foo](/url "title") +. + +. + +error: + +![foo](/url "title")
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5235 + +. +![foo *bar*] + +[foo *bar*]: train.jpg "train & tracks" +. + +. + +error: + +![foo *bar*]
+[foo *bar*]: train.jpg "train & tracks"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5243 + +. +![foo *bar*][] + +[foo *bar*]: train.jpg "train & tracks" +. + +. + +error: + +![foo *bar*][]
+[foo *bar*]: train.jpg "train & tracks"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5251 + +. +![foo *bar*][foobar] + +[FOOBAR]: train.jpg "train & tracks" +. + +. + +error: + +![foo *bar*][foobar]
+[FOOBAR]: train.jpg "train & tracks"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5259 + +. +![foo](train.jpg) +. + +. + +error: + +![foo](train.jpg)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5265 + +. +My ![foo bar](/path/to/train.jpg "title" ) +. +My
+. + +error: + +My ![foo bar](/path/to/train.jpg "title" )
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5271 + +. +![foo](![foo](<url>)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5277 + +. +![](/url) +. + +. + +error: + +![](/url)
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5285 + +. +![foo] [bar] + +[bar]: /url +. + +. + +error: + +![foo] [bar]
+[bar]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5293 + +. +![foo] [bar] + +[BAR]: /url +. + +. + +error: + +![foo] [bar]
+[BAR]: /url
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5303 + +. +![foo][] + +[foo]: /url "title" +. + +. + +error: + +![foo][]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5311 + +. +![*foo* bar][] + +[*foo* bar]: /url "title" +. + +. + +error: + +![*foo* bar][]
+[*foo* bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5321 + +. +![Foo][] + +[foo]: /url "title" +. + +. + +error: + +![Foo][]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5332 + +. +![foo] +[] + +[foo]: /url "title" +. + +. + +error: + +![foo] +[]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5343 + +. +![foo] + +[foo]: /url "title" +. + +. + +error: + +![foo]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5351 + +. +![*foo* bar] + +[*foo* bar]: /url "title" +. + +. + +error: + +![*foo* bar]
+[*foo* bar]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5359 + +. +![[foo]] + +[[foo]]: /url "title" +. + +. + +error: + +![[foo]]
+[[foo]]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5369 + +. +![Foo] + +[foo]: /url "title" +. + +. + +error: + +![Foo]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5380 + +. +\!\[foo] + +[foo]: /url "title" +. +![foo]
+. + +error: + +![foo]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5391 + +. +\![foo] + +[foo]: /url "title" +. +!foo
+. + +error: + +![foo]
+[foo]: /url "title"
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5444 + +. +<http://foo.bar.baz>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5450 + +. +http://foo.bar.baz?q=hello&id=22&boolean
+. + +error: + +<http://foo.bar.baz?q=hello&id=22&boolean>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5456 + +. +<irc://foo.bar:2233/baz>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5464 + +. +<MAILTO:FOO@BAR.BAZ>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5493 + +. +<foo@bar.baz.com>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5499 + +. +<foo+special@Bar.baz-bar0.com>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5627 + +. +<a><bab><c2c>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5635 + +. +<a/><b2/>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5643 + +. +<a /><b2 +data="foo" >
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5653 + +. + +. + +. + +error: + +<a foo="bar" bam = 'baz <em>"</em>' +_boolean zoop:33=zoop:33 />
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5705 + +. ++
</a> +</foo >
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5723 + +. +foo +. +foo
+. + +error: + +foo <!-- this is a +comment - with hyphen -->
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5739 + +. +foo +. +foo
+. + +error: + +foo <?php echo $a; ?>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5747 + +. +foo +. +foo
+. + +error: + +foo <!ELEMENT br EMPTY>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5755 + +. +foo &<]]> +. +foo &<]]>
+. + +error: + +foo <![CDATA[>&<]]>
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5763 + +. + +. + +. + +error: + +<a href="ö">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5771 + +. + +. + +. + +error: + +<a href="*">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5789 + +. +foo +baz +. +foo
+baz
foo +baz
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5800 + +. +foo\ +baz +. +foo
+baz
foo\ +baz
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5810 + +. +foo +baz +. +foo
+baz
foo +baz
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5820 + +. +foo + bar +. +foo
+bar
foo + bar
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5828 + +. +foo\ + bar +. +foo
+bar
foo\ + bar
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5839 + +. +*foo +bar* +. +foo
+bar
*foo +bar*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5847 + +. +*foo\ +bar* +. +foo
+bar
*foo\ +bar*
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5857 + +. +`code +span` +. +code span
`code +span`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5864 + +. +`code\ +span` +. +code\ span
`code\ +span`
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5873 + +. + +. + +. + +error: + +<a href="foo +bar">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5881 + +. + +. + +. + +error: + +<a href="foo\ +bar">
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5908 + +. +foo + baz +. +foo +baz
+. + +error: + +foo + baz
+ + diff --git a/test/fixtures/stmd/good.txt b/test/fixtures/stmd/good.txt new file mode 100644 index 0000000..c21ff48 --- /dev/null +++ b/test/fixtures/stmd/good.txt @@ -0,0 +1,1386 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 279 + +. +*** +--- +___ +. ++++
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 297 + +. +=== +. +===
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 305 + +. +-- +** +__ +. +-- +** +__
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 317 + +. + *** + *** + *** +. +***
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 346
+
+.
+_____________________________________
+.
+_ _ _ _ a
+a------
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 419 + +. +Foo +*** +bar +. +Foo
+bar
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 432 + +. +Foo +--- +bar +. +bar
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 485 + +. +# foo +## foo +### foo +#### foo +##### foo +###### foo +. +####### foo
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 515 + +. +#5 bolt +. +#5 bolt
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 523 + +. +\## foo +. +## foo
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 539 + +. +# foo +. +# foo
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 576
+
+.
+## foo ##
+ ### bar ###
+.
+Foo bar
+Bar foo
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 650 + +. +## +# +### ### +. + + + +. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 724 + +. + Foo + --- + + Foo +--- +. +Foo
+---
+
+Foo
+
+Foo += =
+Foo
+`
+of dashes"/>
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 843 + +. +--- +Foo +--- +Bar +--- +Baz +. +Baz
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 881 + +. + a simple + indented code block +. +a simple
+ indented code block
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 892
+
+.
+
+ *hi*
+
+ - one
+.
+<a/>
+*hi*
+
+- one
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 929
+
+.
+ chunk1
+
+ chunk2
+.
+chunk1
+
+ chunk2
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 956
+
+.
+ foo
+bar
+.
+foo
+
+bar
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 968 + +. +# Header + foo +Header +------ + foo +---- +. +foo
+
+foo
+
+ foo
+bar
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1012
+
+.
+ foo
+.
+foo
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1066
+
+.
+```
+<
+ >
+```
+.
+<
+ >
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1079
+
+.
+~~~
+<
+ >
+~~~
+.
+<
+ >
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1093
+
+.
+```
+aaa
+~~~
+```
+.
+aaa
+~~~
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1104
+
+.
+~~~
+aaa
+```
+~~~
+.
+aaa
+```
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1117
+
+.
+````
+aaa
+```
+``````
+.
+aaa
+```
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1128
+
+.
+~~~~
+aaa
+~~~
+~~~~
+.
+aaa
+~~~
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1141
+
+.
+```
+.
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1147
+
+.
+`````
+
+```
+aaa
+.
+
+```
+aaa
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1161
+
+.
+```
+
+
+```
+.
+
+
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1174
+
+.
+```
+```
+.
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1224
+
+.
+ ```
+ aaa
+ ```
+.
+```
+aaa
+```
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1245
+
+.
+~~~~~~
+aaa
+~~~ ~~
+.
+aaa
+~~~ ~~
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1258
+
+.
+foo
+```
+bar
+```
+baz
+.
+foo
+bar
+
+baz
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1274 + +. +foo +--- +~~~ +bar +~~~ +# baz +. +bar
+
+``` aaa
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 1701
+
+.
+[foo]:
+
+[foo]
+.
+[foo]:
+[foo]
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1762 + +. +[foo]: /url "title" ok +. +[foo]: /url "title" ok
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1771 + +. + [foo]: /url "title" + +[foo] +. +[foo]: /url "title"
+
+[foo]
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1784 + +. +``` +[foo]: /url +``` + +[foo] +. +[foo]: /url
+
+[foo]
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1799 + +. +Foo +[bar]: /baz + +[bar] +. +Foo +[bar]: /baz
+[bar]
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1869 + +. +aaa + +bbb +. +aaa
+bbb
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1880 + +. +aaa +bbb + +ccc +ddd +. +aaa +bbb
+ccc +ddd
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1895 + +. +aaa + + +bbb +. +aaa
+bbb
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1939 + +. + aaa +bbb +. +aaa
+
+bbb
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 2078 + +. + > # Foo + > bar + > baz +. +> # Foo
+> bar
+> baz
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 2642
+
+.
+ indented code
+
+paragraph
+
+ more code
+.
+indented code
+
+paragraph
+more code
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 2806
+
+.
+ 1. A paragraph
+ with two lines.
+
+ indented code
+
+ > A block quote.
+.
+1. A paragraph
+ with two lines.
+
+ indented code
+
+ > A block quote.
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3607
+
+.
+\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~
+.
+!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3625 + +. +\*not emphasized* +\*not emphasized* +<br/> not a tag +[not a link](/foo) +`not code` +1. not a list +* not a list +# not a header +[foo]: /url "not a reference"
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3672 + +. + \[\] +. +\[\]
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3679
+
+.
+~~~
+\[\]
+~~~
+.
+\[\]
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3763
+
+.
+  &x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?;
+.
+  &x; &#; &#x; � &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?;
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3772 + +. +© +. +©
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3828 + +. + föfö +. +föfö
+
+.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3969
+
+.
+`foo
+.
+`foo
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4235 + +. +and * foo bar* +. +and * foo bar*
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4241 + +. +_ foo bar_ +. +_ foo bar_
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4247 + +. +and ** foo bar** +. +and ** foo bar**
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4253 + +. +__ foo bar__ +. +__ foo bar__
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4262 + +. +and *foo bar * +. +and *foo bar *
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4268 + +. +and _foo bar _ +. +and _foo bar _
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4274 + +. +and **foo bar ** +. +and **foo bar **
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4280 + +. +and __foo bar __ +. +and __foo bar __
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4289 + +. +****hi**** +. +****hi****
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4295 + +. +_____hi_____ +. +_____hi_____
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4301 + +. +Sign here: _________ +. +Sign here: _________
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4310 + +. +** is not an empty emphasis +. +** is not an empty emphasis
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4316 + +. +**** is not an empty strong emphasis +. +**** is not an empty strong emphasis
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4345 + +. +foo_bar_baz +. +foo_bar_baz
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4351 + +. +foo__bar__baz +. +foo__bar__baz
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4369 + +. +11_15_32 +. +11_15_32
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4522 + +. +****foo**** +. +****foo****
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4587 + +. +*foo**** +. +*foo****
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4615 + +. +**foo* bar* +. +**foo* bar*
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4627 + +. +***foo* +. +***foo*
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4639 + +. +***foo** +. +***foo**
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4749 + +. +[link](/my uri) +. +[link](/my uri)
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4763 + +. +[link](foo +bar) +. +[link](foo +bar)
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4782 + +. +[link](foo(and(bar))) +. +[link](foo(and(bar)))
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4849 + +. +[link](/url "title "and" title") +. +[link](/url "title "and" title")
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4889 + +. +[link] (/uri) +. +[link] (/uri)
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5472 + +. +<http://foo.bar/baz bim>
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5507 + +. +<> +. +<>
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5513 + +. +<heck://bing.bong>
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5519 + +. +< http://foo.bar > +. +< http://foo.bar >
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5525 + +. +<foo.bar.baz>
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5531 + +. +<localhost:5001/foo>
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5537 + +. +http://google.com +. +http://google.com
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5543 + +. +foo@bar.baz.com +. +foo@bar.baz.com
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5663 + +. +<33> <__> +. +<33> <__>
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5671 + +. + +. +<a h*#ref="hi">
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5679 + +. + +. +</a href="foo">
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5731 + +. +foo +. +foo <!-- not a comment -- two hyphens -->
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5777 + +. + +. +<a href=""">
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5897 + +. +foo +baz +. +foo +baz
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5927 + +. +hello $.;'there +. +hello $.;'there
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5933 + +. +Foo χρῆν +. +Foo χρῆν
+. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 5941 + +. +Multiple spaces +. +Multiple spaces
+. + diff --git a/test/fixtures/stmd/spec.txt b/test/fixtures/stmd/spec.txt new file mode 100644 index 0000000..82ae0b6 --- /dev/null +++ b/test/fixtures/stmd/spec.txt @@ -0,0 +1,6137 @@ +--- +title: CommonMark Spec +author: +- John MacFarlane +version: 1 +date: 2014-09-06 +... + +# Introduction + +## What is Markdown? + +Markdown is a plain text format for writing structured documents, +based on conventions used for indicating formatting in email and +usenet posts. It was developed in 2004 by John Gruber, who wrote +the first Markdown-to-HTML converter in perl, and it soon became +widely used in websites. By 2014 there were dozens of +implementations in many languages. Some of them extended basic +Markdown syntax with conventions for footnotes, definition lists, +tables, and other constructs, and some allowed output not just in +HTML but in LaTeX and many other formats. + +## Why is a spec needed? + +John Gruber's [canonical description of Markdown's +syntax](http://daringfireball.net/projects/markdown/syntax) +does not specify the syntax unambiguously. Here are some examples of +questions it does not answer: + +1. How much indentation is needed for a sublist? The spec says that + continuation paragraphs need to be indented four spaces, but is + not fully explicit about sublists. It is natural to think that + they, too, must be indented four spaces, but `Markdown.pl` does + not require that. This is hardly a "corner case," and divergences + between implementations on this issue often lead to surprises for + users in real documents. (See [this comment by John + Gruber](http://article.gmane.org/gmane.text.markdown.general/1997).) + +2. Is a blank line needed before a block quote or header? + Most implementations do not require the blank line. However, + this can lead to unexpected results in hard-wrapped text, and + also to ambiguities in parsing (note that some implementations + put the header inside the blockquote, while others do not). + (John Gruber has also spoken [in favor of requiring the blank + lines](http://article.gmane.org/gmane.text.markdown.general/2146).) + +3. Is a blank line needed before an indented code block? + (`Markdown.pl` requires it, but this is not mentioned in the + documentation, and some implementations do not require it.) + + ``` markdown + paragraph + code? + ``` + +4. What is the exact rule for determining when list items get + wrapped in `` tags? Can a list be partially "loose" and partially + "tight"? What should we do with a list like this? + + ``` markdown + 1. one + + 2. two + 3. three + ``` + + Or this? + + ``` markdown + 1. one + - a + + - b + 2. two + ``` + + (There are some relevant comments by John Gruber + [here](http://article.gmane.org/gmane.text.markdown.general/2554).) + +5. Can list markers be indented? Can ordered list markers be right-aligned? + + ``` markdown + 8. item 1 + 9. item 2 + 10. item 2a + ``` + +6. Is this one list with a horizontal rule in its second item, + or two lists separated by a horizontal rule? + + ``` markdown + * a + * * * * * + * b + ``` + +7. When list markers change from numbers to bullets, do we have + two lists or one? (The Markdown syntax description suggests two, + but the perl scripts and many other implementations produce one.) + + ``` markdown + 1. fee + 2. fie + - foe + - fum + ``` + +8. What are the precedence rules for the markers of inline structure? + For example, is the following a valid link, or does the code span + take precedence ? + + ``` markdown + [a backtick (`)](/url) and [another backtick (`)](/url). + ``` + +9. What are the precedence rules for markers of emphasis and strong + emphasis? For example, how should the following be parsed? + + ``` markdown + *foo *bar* baz* + ``` + +10. What are the precedence rules between block-level and inline-level + structure? For example, how should the following be parsed? + + ``` markdown + - `a long code span can contain a hyphen like this + - and it can screw things up` + ``` + +11. Can list items include headers? (`Markdown.pl` does not allow this, + but headers can occur in blockquotes.) + + ``` markdown + - # Heading + ``` + +12. Can link references be defined inside block quotes or list items? + + ``` markdown + > Blockquote [foo]. + > + > [foo]: /url + ``` + +13. If there are multiple definitions for the same reference, which takes + precedence? + + ``` markdown + [foo]: /url1 + [foo]: /url2 + + [foo][] + ``` + +In the absence of a spec, early implementers consulted `Markdown.pl` +to resolve these ambiguities. But `Markdown.pl` was quite buggy, and +gave manifestly bad results in many cases, so it was not a +satisfactory replacement for a spec. + +Because there is no unambiguous spec, implementations have diverged +considerably. As a result, users are often surprised to find that +a document that renders one way on one system (say, a github wiki) +renders differently on another (say, converting to docbook using +pandoc). To make matters worse, because nothing in Markdown counts +as a "syntax error," the divergence often isn't discovered right away. + +## About this document + +This document attempts to specify Markdown syntax unambiguously. +It contains many examples with side-by-side Markdown and +HTML. These are intended to double as conformance tests. An +accompanying script `runtests.pl` can be used to run the tests +against any Markdown program: + + perl runtests.pl spec.txt PROGRAM + +Since this document describes how Markdown is to be parsed into +an abstract syntax tree, it would have made sense to use an abstract +representation of the syntax tree instead of HTML. But HTML is capable +of representing the structural distinctions we need to make, and the +choice of HTML for the tests makes it possible to run the tests against +an implementation without writing an abstract syntax tree renderer. + +This document is generated from a text file, `spec.txt`, written +in Markdown with a small extension for the side-by-side tests. +The script `spec2md.pl` can be used to turn `spec.txt` into pandoc +Markdown, which can then be converted into other formats. + +In the examples, the `→` character is used to represent tabs. + +# Preprocessing + +A [line](#line) +is a sequence of zero or more characters followed by a line +ending (CR, LF, or CRLF) or by the end of +file. + +This spec does not specify an encoding; it thinks of lines as composed +of characters rather than bytes. A conforming parser may be limited +to a certain encoding. + +Tabs in lines are expanded to spaces, with a tab stop of 4 characters: + +. +→foo→baz→→bim +. +
foo baz bim
+
+.
+
+.
+ a→a
+ ὐ→a
+.
+a a
+ὐ a
+
+.
+
+Line endings are replaced by newline characters (LF).
+
+A line containing no characters, or a line containing only spaces (after
+tab expansion), is called a [blank line](#blank-line).
+
+
+# Blocks and inlines
+
+We can think of a document as a sequence of [blocks](#block)---structural elements like paragraphs, block quotations,
+lists, headers, rules, and code blocks. Blocks can contain other
+blocks, or they can contain [inline](#inline) content:
+words, spaces, links, emphasized text, images, and inline code.
+
+## Precedence
+
+Indicators of block structure always take precedence over indicators
+of inline structure. So, for example, the following is a list with
+two items, not a list with one item containing a code span:
+
+.
+- `one
+- two`
+.
++++
+. + +. +=== +. +===
+. + +Not enough characters: + +. +-- +** +__ +. +-- +** +__
+. + +One to three spaces indent are allowed: + +. + *** + *** + *** +. +***
+
+.
+
+.
+Foo
+ ***
+.
+Foo +***
+. + +More than three characters may be used: + +. +_____________________________________ +. +_ _ _ _ a
+a------
+. + +It is required that all of the non-space characters be the same. +So, this is not a horizontal rule: + +. + *-* +. +-
+. + +Horizontal rules do not need blank lines before or after: + +. +- foo +*** +- bar +. +Foo
+bar
+. + +Note, however, that this is a setext header, not a paragraph followed +by a horizontal rule: + +. +Foo +--- +bar +. +bar
+. + +When both a horizontal rule and a list item are possible +interpretations of a line, the horizontal rule is preferred: + +. +* Foo +* * * +* Bar +. +####### foo
+. + +A space is required between the `#` characters and the header's +contents. Note that many implementations currently do not require +the space. However, the space was required by the [original ATX +implementation](http://www.aaronsw.com/2002/atx/atx.py), and it helps +prevent things like the following from being parsed as headers: + +. +#5 bolt +. +#5 bolt
+. + +This is not a header, because the first `#` is escaped: + +. +\## foo +. +## foo
+. + +Contents are parsed as inlines: + +. +# foo *bar* \*baz\* +. +# foo
+
+.
+
+.
+foo
+ # bar
+.
+foo +# bar
+. + +A closing sequence of `#` characters is optional: + +. +## foo ## + ### bar ### +. +Foo bar
+Bar foo
+. + +ATX headers can be empty: + +. +## +# +### ### +. + + + +. + +## Setext headers + +A [setext header](#setext-header) +consists of a line of text, containing at least one nonspace character, +with no more than 3 spaces indentation, followed by a [setext header +underline](#setext-header-underline). A [setext header +underline](#setext-header-underline) +is a sequence of `=` characters or a sequence of `-` characters, with no +more than 3 spaces indentation and any number of trailing +spaces. The header is a level 1 header if `=` characters are used, and +a level 2 header if `-` characters are used. The contents of the header +are the result of parsing the first line as Markdown inline content. + +In general, a setext header need not be preceded or followed by a +blank line. However, it cannot interrupt a paragraph, so when a +setext header comes after a paragraph, a blank line is needed between +them. + +Simple examples: + +. +Foo *bar* +========= + +Foo *bar* +--------- +. +Foo
+---
+
+Foo
+
+Foo +---
+. + +The setext header underline cannot contain internal spaces: + +. +Foo += = + +Foo +--- - +. +Foo += =
+Foo
+`
+of dashes"/>
+. + +The setext header underline cannot be a lazy line: + +. +> Foo +--- +. +++Foo
+
Foo +Bar
+Foo +Bar +===
+. + +But in general a blank line is not required before or after: + +. +--- +Foo +--- +Bar +--- +Baz +. +Baz
+. + +Setext headers cannot be empty: + +. + +==== +. +====
+. + + +## Indented code blocks + +An [indented code block](#indented-code-block) + is composed of one or more +[indented chunks](#indented-chunk) separated by blank lines. +An [indented chunk](#indented-chunk) +is a sequence of non-blank lines, each indented four or more +spaces. An indented code block cannot interrupt a paragraph, so +if it occurs before or after a paragraph, there must be an +intervening blank line. The contents of the code block are +the literal contents of the lines, including trailing newlines, +minus four spaces of indentation. An indented code block has no +attributes. + +. + a simple + indented code block +. +a simple
+ indented code block
+
+.
+
+The contents are literal text, and do not get parsed as Markdown:
+
+.
+
+ *hi*
+
+ - one
+.
+<a/>
+*hi*
+
+- one
+
+.
+
+Here we have three chunks separated by blank lines:
+
+.
+ chunk1
+
+ chunk2
+
+
+
+ chunk3
+.
+chunk1
+
+chunk2
+
+
+
+chunk3
+
+.
+
+Any initial spaces beyond four will be included in the content, even
+in interior blank lines:
+
+.
+ chunk1
+
+ chunk2
+.
+chunk1
+
+ chunk2
+
+.
+
+An indented code block cannot interrupt a paragraph. (This
+allows hanging indents and the like.)
+
+.
+Foo
+ bar
+
+.
+Foo +bar
+. + +However, any non-blank line with fewer than four leading spaces ends +the code block immediately. So a paragraph may occur immediately +after indented code: + +. + foo +bar +. +foo
+
+bar
+. + +And indented code can occur immediately before and after other kinds of +blocks: + +. +# Header + foo +Header +------ + foo +---- +. +foo
+
+foo
+
+ foo
+bar
+
+.
+
+Blank lines preceding or following an indented code block
+are not included in it:
+
+.
+
+
+ foo
+
+
+.
+foo
+
+.
+
+Trailing spaces are included in the code block's content:
+
+.
+ foo
+.
+foo
+
+.
+
+
+## Fenced code blocks
+
+A [code fence](#code-fence) is a sequence
+of at least three consecutive backtick characters (`` ` ``) or
+tildes (`~`). (Tildes and backticks cannot be mixed.)
+A [fenced code block](#fenced-code-block)
+begins with a code fence, indented no more than three spaces.
+
+The line with the opening code fence may optionally contain some text
+following the code fence; this is trimmed of leading and trailing
+spaces and called the [info string](#info-string).
+ The info string may not contain any backtick
+characters. (The reason for this restriction is that otherwise
+some inline code would be incorrectly interpreted as the
+beginning of a fenced code block.)
+
+The content of the code block consists of all subsequent lines, until
+a closing [code fence](#code-fence) of the same type as the code block
+began with (backticks or tildes), and with at least as many backticks
+or tildes as the opening code fence. If the leading code fence is
+indented N spaces, then up to N spaces of indentation are removed from
+each line of the content (if present). (If a content line is not
+indented, it is preserved unchanged. If it is indented less than N
+spaces, all of the indentation is removed.)
+
+The closing code fence may be indented up to three spaces, and may be
+followed only by spaces, which are ignored. If the end of the
+containing block (or document) is reached and no closing code fence
+has been found, the code block contains all of the lines after the
+opening code fence until the end of the containing block (or
+document). (An alternative spec would require backtracking in the
+event that a closing code fence is not found. But this makes parsing
+much less efficient, and there seems to be no real down side to the
+behavior described here.)
+
+A fenced code block may interrupt a paragraph, and does not require
+a blank line either before or after.
+
+The content of a code fence is treated as literal text, not parsed
+as inlines. The first word of the info string is typically used to
+specify the language of the code sample, and rendered in the `class`
+attribute of the `pre` tag. However, this spec does not mandate any
+particular treatment of the info string.
+
+Here is a simple example with backticks:
+
+.
+```
+<
+ >
+```
+.
+<
+ >
+
+.
+
+With tildes:
+
+.
+~~~
+<
+ >
+~~~
+.
+<
+ >
+
+.
+
+The closing code fence must use the same character as the opening
+fence:
+
+.
+```
+aaa
+~~~
+```
+.
+aaa
+~~~
+
+.
+
+.
+~~~
+aaa
+```
+~~~
+.
+aaa
+```
+
+.
+
+The closing code fence must be at least as long as the opening fence:
+
+.
+````
+aaa
+```
+``````
+.
+aaa
+```
+
+.
+
+.
+~~~~
+aaa
+~~~
+~~~~
+.
+aaa
+~~~
+
+.
+
+Unclosed code blocks are closed by the end of the document:
+
+.
+```
+.
+
+.
+
+.
+`````
+
+```
+aaa
+.
+
+```
+aaa
+
+.
+
+A code block can have all empty lines as its content:
+
+.
+```
+
+
+```
+.
+
+
+
+.
+
+A code block can be empty:
+
+.
+```
+```
+.
+
+.
+
+Fences can be indented. If the opening fence is indented,
+content lines will have equivalent opening indentation removed,
+if present:
+
+.
+ ```
+ aaa
+aaa
+```
+.
+aaa
+aaa
+
+.
+
+.
+ ```
+aaa
+ aaa
+aaa
+ ```
+.
+aaa
+aaa
+aaa
+
+.
+
+.
+ ```
+ aaa
+ aaa
+ aaa
+ ```
+.
+aaa
+ aaa
+aaa
+
+.
+
+Four spaces indentation produces an indented code block:
+
+.
+ ```
+ aaa
+ ```
+.
+```
+aaa
+```
+
+.
+
+Code fences (opening and closing) cannot contain internal spaces:
+
+.
+``` ```
+aaa
+.
+
+aaa
aaa
+~~~ ~~
+
+.
+
+Fenced code blocks can interrupt paragraphs, and can be followed
+directly by paragraphs, without a blank line between:
+
+.
+foo
+```
+bar
+```
+baz
+.
+foo
+bar
+
+baz
+. + +Other blocks can also occur before and after fenced code blocks +without an intervening blank line: + +. +foo +--- +~~~ +bar +~~~ +# baz +. +bar
+
+def foo(x)
+ return 3
+end
+
+.
+
+.
+~~~~ ruby startline=3 $%@#$
+def foo(x)
+ return 3
+end
+~~~~~~~
+.
+def foo(x)
+ return 3
+end
+
+.
+
+.
+````;
+````
+.
+
+.
+
+Info strings for backtick code blocks cannot contain backticks:
+
+.
+``` aa ```
+foo
+.
+aa
+foo
``` aaa
+
+.
+
+
+## HTML blocks
+
+An [HTML block tag](#html-block-tag) is
+an [open tag](#open-tag) or [closing tag](#closing-tag) whose tag
+name is one of the following (case-insensitive):
+`article`, `header`, `aside`, `hgroup`, `blockquote`, `hr`, `iframe`,
+`body`, `li`, `map`, `button`, `object`, `canvas`, `ol`, `caption`,
+`output`, `col`, `p`, `colgroup`, `pre`, `dd`, `progress`, `div`,
+`section`, `dl`, `table`, `td`, `dt`, `tbody`, `embed`, `textarea`,
+`fieldset`, `tfoot`, `figcaption`, `th`, `figure`, `thead`, `footer`,
+`footer`, `tr`, `form`, `ul`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`,
+`video`, `script`, `style`.
+
+An [HTML block](#html-block) begins with an
+[HTML block tag](#html-block-tag), [HTML comment](#html-comment),
+[processing instruction](#processing-instruction),
+[declaration](#declaration), or [CDATA section](#cdata-section).
+It ends when a [blank line](#blank-line) or the end of the
+input is encountered. The initial line may be indented up to three
+spaces, and subsequent lines may have any indentation. The contents
+of the HTML block are interpreted as raw HTML, and will not be escaped
+in HTML output.
+
+Some simple examples:
+
+.
++ hi + | +
+ hi + | +
okay.
+. + +. +Markdown
+<!-- foo -->
+
+.
+
+An HTML block can interrupt a paragraph, and need not be preceded
+by a blank line.
+
+.
+Foo
+Foo
+