HTML blocks of types 1-5 (e.g. `<!--` comments) must continue until
their closing sequence (`-->` for comments), per CommonMark. Only
types 6 and 7 end on a blank line.
The block scanner broke out of the continuation loop whenever a line
was outdented below the current block indent. Inside a container such
as a list item, a blank line is outdented (its sCount is 0), so a
comment block was terminated early instead of running to `-->`.
Skip that break for outdented blank lines unless the block type
actually ends on a blank line, so comment blocks no longer depend on
indentation. Adds regression fixtures for issue #1144.
Co-authored-by: ATOM00blue <219721791+ATOM00blue@users.noreply.github.com>
The spec update changes these things:
* It simplifies the HTML regex so that `<!-- a -- b -->` is an HTML
comment. HTML5 reports this as an error, but still parses it.
* It changes the set of known HTML block elements to match HTML5, adding
`search` and removing `source`.
* It adds Unicode Symbols to the set of punctuation characters that are
used to evaluate flankingness.
This commit also changes the declaration HTML regex to match lowercase,
even though that change was technically made in spec version 0.30.
Spec is not clear on how to handle this. Three variations exist:
```
$ echo '' | /home/user/commonmark.js/bin/commonmark
<p><img src="image.png" alt="text <textarea> text" /></p>
$ echo '' | /home/user/cmark/build/src/cmark
<p><img src="image.png" alt="text <textarea> text" /></p>
$ echo '' | /home/user/.local/bin/commonmark
<p><img src="image.png" alt="text text" /></p>
```
Prior to this commit:
- when HTML tags are enabled, tags were removed (as in Haskell version)
- when HTML tags are disabled, tags were escaped (as in C version)
After this commit:
- tags will be escaped (as in C version) regardless of HTML flag
+ render hardbreaks as newlines, same as cmark