diff --git a/test/fixtures/stmd/bad.txt b/test/fixtures/stmd/bad.txt index 851a0f3..f7ce131 100644 --- a/test/fixtures/stmd/bad.txt +++ b/test/fixtures/stmd/bad.txt @@ -20,6 +20,40 @@ error:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 1678 + +. +[Foo bar]: +& © Æ Ď ¾ ℋ ⅆ ∲
+. + +error: + +& © Æ Ď ¾ ℋ ⅆ ∲
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3757 + +. +# Ӓ Ϡ +. +# Ӓ Ϡ �
+. + +error: + +# Ӓ Ϡ
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3767 + +. +" ആ ಫ +. +" ആ ಫ
+. + +error: + +" ആ ಫ
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3792 + +. +&MadeUpEntity; +. +&MadeUpEntity;
+. + +error: + +&MadeUpEntity;
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3808 + +. +[foo](/föö "föö") +. + +. + +error: + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3814 + +. +[foo] + +[foo]: /föö "föö" +. + +. + +error: + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3822 + +. +``` föö +foo +``` +. +foo
+
+.
+
+error:
+
+foo
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+src line: 3957
+
+.
+& © Æ Ď ¾ ℋ ⅆ ∲
-. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3745 - -. - # Ӓ Ϡ -. -# Ӓ Ϡ
-. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3755 - -. - " ആ ಫ -. -" ആ ಫ
-. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3763 +src line: 3775 . -  &x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; +  &x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; . -  &x; &#; &#x; � &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?;
+  &x; &#; &#x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?;
. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3772 +src line: 3784 . © @@ -3156,16 +3096,7 @@ src line: 3772 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3781 - -. -&MadeUpEntity; -. -&MadeUpEntity;
-. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3791 +src line: 3802 . @@ -3174,39 +3105,7 @@ src line: 3791 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3797 - -. -[foo](/föö "föö") -. - -. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3803 - -. -[foo] - -[foo]: /föö "föö" -. - -. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 3811 - -. -``` föö -foo -``` -. -foo
-
-.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3822
+src line: 3833
.
`föö`
@@ -3215,7 +3114,7 @@ src line: 3822
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3828
+src line: 3839
.
föfö
@@ -3225,7 +3124,7 @@ src line: 3828
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3849
+src line: 3860
.
`foo`
@@ -3234,7 +3133,7 @@ src line: 3849
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3858
+src line: 3869
.
`` foo ` bar ``
@@ -3243,7 +3142,7 @@ src line: 3858
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3867
+src line: 3878
.
` `` `
@@ -3252,7 +3151,7 @@ src line: 3867
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3875
+src line: 3886
.
``
@@ -3263,7 +3162,7 @@ foo
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3886
+src line: 3897
.
`foo bar
@@ -3273,7 +3172,7 @@ src line: 3886
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3906
+src line: 3917
.
`foo `` bar`
@@ -3282,7 +3181,7 @@ src line: 3906
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3915
+src line: 3926
.
`foo\`bar`
@@ -3291,7 +3190,7 @@ src line: 3915
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3930
+src line: 3941
.
*foo`*`
@@ -3300,7 +3199,7 @@ src line: 3930
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3938
+src line: 3949
.
[not a `link](/foo`)
@@ -3309,16 +3208,7 @@ src line: 3938
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-src line: 3946
-
-.
-& © Æ Ď ¾ ℋ ⅆ ∲
+& © Æ Ď ¾ ℋ ⅆ ∲
. [Decimal entities](#decimal-entities) -consist of `` + a string of 1--8 arabic digits + `;`. +consist of `` + a string of 1--8 arabic digits + `;`. Again, these entities need to be recognised +and tranformed into their corresponding UTF8 codepoints. Invalid Unicode codepoints will be written +as the "unknown codepoint" character (`0xFFFD`) . - # Ӓ Ϡ +# Ӓ Ϡ . -# Ӓ Ϡ
+# Ӓ Ϡ �
. [Hexadecimal entities](#hexadecimal-entities) consist of `` + either `X` or `x` + a string of 1-8 hexadecimal digits -+ `;`. ++ `;`. They will also be parsed and turned into their corresponding UTF8 values in the AST. . - " ആ ಫ +" ആ ಫ . -" ആ ಫ
+" ആ ಫ
. Here are some nonentities: . -  &x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; +  &x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; . -  &x; &#; &#x; � &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?;
+  &x; &#; &#x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?;
. Although HTML5 does accept some entities without a trailing semicolon -(such as `©`), these are not recognized as entities here: +(such as `©`), these are not recognized as entities here, because it makes the grammar too ambiguous: . © @@ -3775,13 +3787,12 @@ Although HTML5 does accept some entities without a trailing semicolon©
. -On the other hand, many strings that are not on the list of HTML5 -named entities are recognized as entities here: +Strings that are not on the list of HTML5 named entities are not recognized as entities either: . &MadeUpEntity; . -&MadeUpEntity;
+&MadeUpEntity;
. Entities are recognized in any context besides code spans or @@ -3797,7 +3808,7 @@ code blocks, including raw HTML, URLs, [link titles](#link-title), and . [foo](/föö "föö") . - + . . @@ -3805,7 +3816,7 @@ code blocks, including raw HTML, URLs, [link titles](#link-title), and [foo]: /föö "föö" . - + . . @@ -3813,7 +3824,7 @@ code blocks, including raw HTML, URLs, [link titles](#link-title), and foo ``` . -foo
+foo
.
@@ -3946,7 +3957,7 @@ But this is a link:
.
`
.
-
+
.
And this is an HTML tag:
@@ -4030,7 +4041,7 @@ for efficient parsing strategies that do not backtrack:
(a) it is not part of a sequence of four or more unescaped `_`s,
(b) it is not followed by whitespace,
- (c) is is not preceded by an ASCII alphanumeric character, and
+ (c) it is not preceded by an ASCII alphanumeric character, and
(d) either it is not followed by a `_` character or it is
followed immediately by strong emphasis.
@@ -4755,7 +4766,7 @@ braces:
.
[link]()
.
-
+
.
The destination cannot contain line breaks, even with pointy braces:
@@ -4806,12 +4817,14 @@ in Markdown:
.
-URL-escaping and entities should be left alone inside the destination:
+URL-escaping and should be left alone inside the destination, as all URL-escaped characters
+are also valid URL characters. HTML entities in the destination will be parsed into their UTF8
+codepoints, as usual, and optionally URL-escaped when written as HTML.
.
[link](foo%20bä)
.
-
+
.
Note that, because titles can often be parsed as destinations,
@@ -4821,7 +4834,7 @@ get unexpected results:
.
[link]("title")
.
-
+
.
Titles may be in single quotes, double quotes, or parentheses: