summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/regression.txt31
-rw-r--r--test/spec.txt88
2 files changed, 89 insertions, 30 deletions
diff --git a/test/regression.txt b/test/regression.txt
index 4ec2c25..62b1e7e 100644
--- a/test/regression.txt
+++ b/test/regression.txt
@@ -81,7 +81,8 @@ Issue #193 - unescaped left angle brackets in link destination
[a]: <te<st>
.
-<p><a href="%3Cte%3Cst%3E">a</a></p>
+<p>[a]</p>
+<p>[a]: &lt;te<st></p>
````````````````````````````````
Issue #192 - escaped spaces in link destination
@@ -118,8 +119,9 @@ Issue #530 - link parsing corner cases
)
.
<p>[a](\ b)</p>
-<p><a href="%3C%3Cb">a</a></p>
-<p><a href="%3Cb">a</a></p>
+<p>[a](&lt;&lt;b)</p>
+<p>[a](&lt;b
+)</p>
````````````````````````````````
Issue commonmark#526 - unescaped ( in link title
@@ -129,3 +131,26 @@ Issue commonmark#526 - unescaped ( in link title
.
<p>[link](url ((title))</p>
````````````````````````````````
+
+Issue commonamrk#517 - script, pre, style close tag without
+opener.
+
+```````````````````````````````` example
+</script>
+
+</pre>
+
+</style>
+.
+</script>
+</pre>
+</style>
+````````````````````````````````
+
+Issue #289.
+
+```````````````````````````````` example
+[a](<b) c>
+.
+<p>[a](&lt;b) c&gt;</p>
+````````````````````````````````
diff --git a/test/spec.txt b/test/spec.txt
index 91551e5..4162938 100644
--- a/test/spec.txt
+++ b/test/spec.txt
@@ -328,8 +328,10 @@ that is not a [whitespace character].
An [ASCII punctuation character](@)
is `!`, `"`, `#`, `$`, `%`, `&`, `'`, `(`, `)`,
-`*`, `+`, `,`, `-`, `.`, `/`, `:`, `;`, `<`, `=`, `>`, `?`, `@`,
-`[`, `\`, `]`, `^`, `_`, `` ` ``, `{`, `|`, `}`, or `~`.
+`*`, `+`, `,`, `-`, `.`, `/` (U+0021–2F),
+`:`, `;`, `<`, `=`, `>`, `?`, `@` (U+003A–0040),
+`[`, `\`, `]`, `^`, `_`, `` ` `` (U+005B–0060),
+`{`, `|`, `}`, or `~` (U+007B–007E).
A [punctuation character](@) is an [ASCII
punctuation character] or anything in
@@ -1922,9 +1924,11 @@ bar
An [info string] can be provided after the opening code fence.
-Opening and closing spaces will be stripped, and the first word, prefixed
-with `language-`, is used as the value for the `class` attribute of the
-`code` element within the enclosing `pre` element.
+Although this spec doesn't mandate any particular treatment of
+the info string, the first word is typically used to specify
+the language of the code block. In HTML output, the language is
+normally indicated by adding a class to the `code` element consisting
+of `language-` followed by the language name.
```````````````````````````````` example
```ruby
@@ -2003,15 +2007,15 @@ Closing code fences cannot have [info strings]:
An [HTML block](@) is a group of lines that is treated
as raw HTML (and will not be escaped in HTML output).
-There are seven kinds of [HTML block], which can be defined
-by their start and end conditions. The block begins with a line that
-meets a [start condition](@) (after up to three spaces
-optional indentation). It ends with the first subsequent line that
-meets a matching [end condition](@), or the last line of
-the document or other [container block](#container-blocks)), if no
-line is encountered that meets the [end condition]. If the first line
-meets both the [start condition] and the [end condition], the block
-will contain just that line.
+There are seven kinds of [HTML block], which can be defined by their
+start and end conditions. The block begins with a line that meets a
+[start condition](@) (after up to three spaces optional indentation).
+It ends with the first subsequent line that meets a matching [end
+condition](@), or the last line of the document, or the last line of
+the [container block](#container-blocks) containing the current HTML
+block, if no line is encountered that meets the [end condition]. If
+the first line meets both the [start condition] and the [end
+condition], the block will contain just that line.
1. **Start condition:** line begins with the string `<script`,
`<pre`, or `<style` (case-insensitive), followed by whitespace,
@@ -2050,9 +2054,9 @@ the string `/>`.\
**End condition:** line is followed by a [blank line].
7. **Start condition:** line begins with a complete [open tag]
-or [closing tag] (with any [tag name] other than `script`,
-`style`, or `pre`) followed only by [whitespace]
-or the end of the line.\
+(with any [tag name] other than `script`,
+`style`, or `pre`) or a complete [closing tag],
+followed only by [whitespace] or the end of the line.\
**End condition:** line is followed by a [blank line].
HTML blocks continue until they are closed by their appropriate
@@ -6107,7 +6111,8 @@ The following rules define emphasis and strong emphasis:
[delimiter runs]. If one of the delimiters can both
open and close emphasis, then the sum of the lengths of the
delimiter runs containing the opening and closing delimiters
- must not be a multiple of 3.
+ must not be a multiple of 3 unless both lengths are
+ multiples of 3.
10. Strong emphasis begins with a delimiter that
[can open strong emphasis] and ends with a delimiter that
@@ -6117,7 +6122,8 @@ The following rules define emphasis and strong emphasis:
[delimiter runs]. If one of the delimiters can both open
and close strong emphasis, then the sum of the lengths of
the delimiter runs containing the opening and closing
- delimiters must not be a multiple of 3.
+ delimiters must not be a multiple of 3 unless both lengths
+ are multiples of 3.
11. A literal `*` character cannot occur at the beginning or end of
`*`-delimited emphasis or `**`-delimited strong emphasis, unless it
@@ -6736,7 +6742,8 @@ is precluded by the condition that a delimiter that
can both open and close (like the `*` after `foo`)
cannot form emphasis if the sum of the lengths of
the delimiter runs containing the opening and
-closing delimiters is a multiple of 3.
+closing delimiters is a multiple of 3 unless
+both lengths are multiples of 3.
For the same reason, we don't get two consecutive
@@ -6776,6 +6783,23 @@ omitted:
````````````````````````````````
+When the lengths of the interior closing and opening
+delimiter runs are *both* multiples of 3, though,
+they can match to create emphasis:
+
+```````````````````````````````` example
+foo***bar***baz
+.
+<p>foo<em><strong>bar</strong></em>baz</p>
+````````````````````````````````
+
+```````````````````````````````` example
+foo******bar*********baz
+.
+<p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p>
+````````````````````````````````
+
+
Indefinite levels of nesting are possible:
```````````````````````````````` example
@@ -7314,12 +7338,13 @@ A [link destination](@) consists of either
closing `>` that contains no line breaks or unescaped
`<` or `>` characters, or
-- a nonempty sequence of characters that does not include
- ASCII space or control characters, and includes parentheses
- only if (a) they are backslash-escaped or (b) they are part of
- a balanced pair of unescaped parentheses. (Implementations
- may impose limits on parentheses nesting to avoid performance
- issues, but at least three levels of nesting should be supported.)
+- a nonempty sequence of characters that does not start with
+ `<`, does not include ASCII space or control characters, and
+ includes parentheses only if (a) they are backslash-escaped or
+ (b) they are part of a balanced pair of unescaped parentheses.
+ (Implementations may impose limits on parentheses nesting to
+ avoid performance issues, but at least three levels of nesting
+ should be supported.)
A [link title](@) consists of either
@@ -7417,6 +7442,15 @@ bar>)
bar>)</p>
````````````````````````````````
+Pointy brackets that enclose links must be unescaped:
+
+```````````````````````````````` example
+[link](<foo\>)
+.
+<p>[link](&lt;foo&gt;)</p>
+````````````````````````````````
+
+
Parentheses inside the link destination may be escaped:
```````````````````````````````` example
@@ -9515,7 +9549,7 @@ closers:
of the delimiter stack. If the closing node is removed, reset
`current_position` to the next element in the stack.
-- If none in found:
+- If none is found:
+ Set `openers_bottom` to the element before `current_position`.
(We know that there are no openers for this kind of closer up to and