test/spec.txt: Update from upstream head.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
diff --git a/test/spec.txt b/test/spec.txt
index 6384390..3913de4 100644
--- a/test/spec.txt
+++ b/test/spec.txt
@@ -1,8 +1,8 @@
---
title: CommonMark Spec
author: John MacFarlane
-version: 0.28
-date: '2017-08-01'
+version: 0.29
+date: '2019-04-06'
license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)'
...
@@ -827,7 +827,7 @@ Contents are parsed as inlines:
````````````````````````````````
-Leading and trailing blanks are ignored in parsing inline content:
+Leading and trailing [whitespace] is ignored in parsing inline content:
```````````````````````````````` example
# foo
@@ -1026,6 +1026,20 @@ baz*
baz</em></h1>
````````````````````````````````
+The contents are the result of parsing the headings's raw
+content as inlines. The heading's raw content is formed by
+concatenating the lines and removing initial and final
+[whitespace].
+
+```````````````````````````````` example
+ Foo *bar
+baz*→
+====
+.
+<h1>Foo <em>bar
+baz</em></h1>
+````````````````````````````````
+
The underlining can be any length:
@@ -3076,6 +3090,25 @@ and thematic breaks, and it need not be followed by a blank line.
</blockquote>
````````````````````````````````
+```````````````````````````````` example
+[foo]: /url
+bar
+===
+[foo]
+.
+<h1>bar</h1>
+<p><a href="/url">foo</a></p>
+````````````````````````````````
+
+```````````````````````````````` example
+[foo]: /url
+===
+[foo]
+.
+<p>===
+<a href="/url">foo</a></p>
+````````````````````````````````
+
Several [link reference definitions]
can occur one after another, without intervening blank lines.
@@ -3112,6 +3145,17 @@ are defined:
````````````````````````````````
+Whether something is a [link reference definition] is
+independent of whether the link reference it defines is
+used in the document. Thus, for example, the following
+document contains just a link reference definition, and
+no visible content:
+
+```````````````````````````````` example
+[foo]: /url
+.
+````````````````````````````````
+
## Paragraphs
@@ -5458,10 +5502,10 @@ Thus, for example, in
<p><code>hi</code>lo`</p>
````````````````````````````````
-
`hi` is parsed as code, leaving the backtick at the end as a literal
backtick.
+
## Backslash escapes
Any ASCII punctuation character may be backslash-escaped:
@@ -5495,6 +5539,7 @@ not have their usual Markdown meanings:
\* not a list
\# not a heading
\[foo]: /url "not a reference"
+\ö not a character entity
.
<p>*not emphasized*
<br/> not a tag
@@ -5503,7 +5548,8 @@ not have their usual Markdown meanings:
1. not a list
* not a list
# not a heading
-[foo]: /url "not a reference"</p>
+[foo]: /url "not a reference"
+&ouml; not a character entity</p>
````````````````````````````````
@@ -5601,13 +5647,23 @@ foo
## Entity and numeric character references
-All valid HTML entity references and numeric character
-references, except those occurring in code blocks and code spans,
-are recognized as such and treated as equivalent to the
-corresponding Unicode characters. Conforming CommonMark parsers
-need not store information about whether a particular character
-was represented in the source using a Unicode character or
-an entity reference.
+Valid HTML entity references and numeric character references
+can be used in place of the corresponding Unicode character,
+with the following exceptions:
+
+- Entity and character references are not recognized in code
+ blocks and code spans.
+
+- Entity and character references cannot stand in place of
+ special characters that define structural elements in
+ CommonMark. For example, although `*` can be used
+ in place of a literal `*` character, `*` cannot replace
+ `*` in emphasis delimiters, bullet list markers, or thematic
+ breaks.
+
+Conforming CommonMark parsers need not store information about
+whether a particular character was represented in the source
+using a Unicode character or an entity reference.
[Entity references](@) consist of `&` + any of the valid
HTML5 entity names + `;`. The
@@ -5745,6 +5801,51 @@ text in code spans and code blocks:
````````````````````````````````
+Entity and numeric character references cannot be used
+in place of symbols indicating structure in CommonMark
+documents.
+
+```````````````````````````````` example
+*foo*
+*foo*
+.
+<p>*foo*
+<em>foo</em></p>
+````````````````````````````````
+
+```````````````````````````````` example
+* foo
+
+* foo
+.
+<p>* foo</p>
+<ul>
+<li>foo</li>
+</ul>
+````````````````````````````````
+
+```````````````````````````````` example
+foo bar
+.
+<p>foo
+
+bar</p>
+````````````````````````````````
+
+```````````````````````````````` example
+	foo
+.
+<p>→foo</p>
+````````````````````````````````
+
+
+```````````````````````````````` example
+[a](url "tit")
+.
+<p>[a](url "tit")</p>
+````````````````````````````````
+
+
## Code spans
A [backtick string](@)
@@ -7464,6 +7565,15 @@ bar>)
bar>)</p>
````````````````````````````````
+The destination can contain `)` if it is enclosed
+in pointy brackets:
+
+```````````````````````````````` example
+[a](<b)c>)
+.
+<p><a href="b)c">a</a></p>
+````````````````````````````````
+
Pointy brackets that enclose links must be unescaped:
```````````````````````````````` example
@@ -7472,6 +7582,18 @@ Pointy brackets that enclose links must be unescaped:
<p>[link](<foo>)</p>
````````````````````````````````
+These are not links, because the opening pointy bracket
+is not matched properly:
+
+```````````````````````````````` example
+[a](<b)c
+[a](<b)c>
+[a](<b>c)
+.
+<p>[a](<b)c
+[a](<b)c>
+[a](<b>c)</p>
+````````````````````````````````
Parentheses inside the link destination may be escaped:
@@ -8580,7 +8702,7 @@ If you want a link after a literal `!`, backslash-escape the
as the link label.
A [URI autolink](@) consists of `<`, followed by an
-[absolute URI] not containing `<`, followed by `>`. It is parsed as
+[absolute URI] followed by `>`. It is parsed as
a link to the URI, with the URI as the link's label.
An [absolute URI](@),