# Regression tests

Eating a character after a partially consumed tab.

```````````````````````````````` example
* foo
→bar
.
<ul>
<li>foo
bar</li>
</ul>
````````````````````````````````

Type 7 HTML block followed by whitespace (#98).

```````````````````````````````` example
<a>  
x
.
<a>  
x
````````````````````````````````

h2..h6 raw HTML blocks (jgm/CommonMark#430).

```````````````````````````````` example
<h1>lorem</h1>

<h2>lorem</h2>

<h3>lorem</h3>

<h4>lorem</h4>

<h5>lorem</h5>

<h6>lorem</h6>
.
<h1>lorem</h1>
<h2>lorem</h2>
<h3>lorem</h3>
<h4>lorem</h4>
<h5>lorem</h5>
<h6>lorem</h6>
````````````````````````````````

Issue #109 - tabs after setext header line


```````````````````````````````` example
hi
--→
.
<h2>hi</h2>
````````````````````````````````

Issue #108 - Chinese punctuation not recognized

```````````````````````````````` example
**。**话
.
<p>**。**话</p>
````````````````````````````````

Issue jgm/cmark#177 - incorrect emphasis parsing

```````````````````````````````` example
a***b* c*
.
<p>a*<em><em>b</em> c</em></p>
````````````````````````````````

Issue jgm/CommonMark#468 - backslash at end of link definition


```````````````````````````````` example
[\]: test
.
<p>[]: test</p>
````````````````````````````````

Issue commonmark/commonmark.js#121 - punctuation set different

```````````````````````````````` example
^_test_
.
<p>^<em>test</em></p>
````````````````````````````````

Issue #116 - tabs before and after ATX closing heading
```````````````````````````````` example
# foo→#→
.
<h1>foo</h1>
````````````````````````````````

commonmark/CommonMark#493 - escaped space not allowed in link destination.

```````````````````````````````` example
[link](a\ b)
.
<p>[link](a\ b)</p>
````````````````````````````````

Issue #527 - meta tags in inline contexts

```````````````````````````````` example
City:
<span itemprop="contentLocation" itemscope itemtype="https://schema.org/City">
  <meta itemprop="name" content="Springfield">
</span>
.
<p>City:
<span itemprop="contentLocation" itemscope itemtype="https://schema.org/City">
<meta itemprop="name" content="Springfield">
</span></p>
````````````````````````````````

Double-encoding.

```````````````````````````````` example
[XSS](javascript&amp;colon;alert%28&#039;XSS&#039;%29)
.
<p><a href="javascript&amp;colon;alert%28'XSS'%29">XSS</a></p>
````````````````````````````````

PR #179

```````````````````````````````` example
[link](https://www.example.com/home/%25batty)
.
<p><a href="https://www.example.com/home/%25batty">link</a></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>
````````````````````````````````

Issue #161.

```````````````````````````````` example
*failed to be italic!*\
text
.
<p><em>failed to be italic!</em><br />
text</p>
````````````````````````````````

Issue #196.

```````````````````````````````` example
a <?
?>
.
<p>a <?
?></p>
````````````````````````````````

Issue #211

```````````````````````````````` example
[\
foo]: /uri

[\
foo]
.
<p><a href="/uri"><br />
foo</a></p>
````````````````````````````````

Issue #213 - type 7 blocks can't interrupt
paragraph

```````````````````````````````` example
- <script>
- some text
some other text
</script>
.
<ul>
<li>
<script>
</li>
<li>some text
some other text
</script></li>
</ul>
````````````````````````````````

Issue cmark/#383 - emphasis parsing.

```````````````````````````````` example
*****Hello*world****
.
<p>**<em><strong>Hello<em>world</em></strong></em></p>
````````````````````````````````

Issue reported at
https://talk.commonmark.org/t/link-label-collapse-all-internal-whitespace/3919/5

```````````````````````````````` example
[foo][one two
  three]

[one two three]: /url "title"
.
<p><a href="/url" title="title">foo</a></p>
````````````````````````````````

Issue #258

```````````````````````````````` example
```
abc
```     
.
<pre><code>abc
</code></pre>
````````````````````````````````

`<!doctype` is case-insensitive
```````````````````````````````` example
<!docType html>
.
<!docType html>
````````````````````````````````

Declarations don't need spaces, according to the spec (cmark#456)
```````````````````````````````` example
x <!A>
.
<p>x <!A></p>
````````````````````````````````

Block-quoted blank line shouldn't make parent list loose.
```````````````````````````````` example
## Case 1

- > a
  >
- b


## Case 2

- > - a
  >
- b


## Case 3

- > > a
  >
- b


## Case 4

- > # a
  >
- b


## Case 5

- ```
  The following line is part of code block.

- b

## Case 6

-     The following line is **not** part of code block.
      
- b

## Case 7

- <pre>The following line is part of HTML block.

- </pre>
- b
.
<h2>Case 1</h2>
<ul>
<li>
<blockquote>
<p>a</p>
</blockquote>
</li>
<li>b</li>
</ul>
<h2>Case 2</h2>
<ul>
<li>
<blockquote>
<ul>
<li>a</li>
</ul>
</blockquote>
</li>
<li>b</li>
</ul>
<h2>Case 3</h2>
<ul>
<li>
<blockquote>
<blockquote>
<p>a</p>
</blockquote>
</blockquote>
</li>
<li>b</li>
</ul>
<h2>Case 4</h2>
<ul>
<li>
<blockquote>
<h1>a</h1>
</blockquote>
</li>
<li>b</li>
</ul>
<h2>Case 5</h2>
<ul>
<li>
<pre><code>The following line is part of code block.

</code></pre>
</li>
<li>b</li>
</ul>
<h2>Case 6</h2>
<ul>
<li>
<pre><code>The following line is **not** part of code block.
</code></pre>
</li>
<li>
<p>b</p>
</li>
</ul>
<h2>Case 7</h2>
<ul>
<li>
<pre>The following line is part of HTML block.

</li>
<li>
</pre>
</li>
<li>b</li>
</ul>
````````````````````````````````

Link reference definitions are blocks when checking list tightness.
```````````````````````````````` example
## Case 1

- [aaa]: /

  [aaa]: /
- b


## Case 2

- a

  [aaa]: /
- b


## Case 3

- [aaa]: /

  a
- b
.
<h2>Case 1</h2>
<ul>
<li></li>
<li>
<p>b</p>
</li>
</ul>
<h2>Case 2</h2>
<ul>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
</ul>
<h2>Case 3</h2>
<ul>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
</ul>
````````````````````````````````

An underscore that is not part of a delimiter should not prevent another
pair of underscores from forming part of their own.
```````````````````````````````` example
__!_!__

__!x!__

**!*!**

---

_*__*_*

_*xx*_*

_*__-_-

_*xx-_-
.
<p><strong>!_!</strong></p>
<p><strong>!x!</strong></p>
<p><strong>!*!</strong></p>
<hr />
<p><em><em>__</em></em>*</p>
<p><em><em>xx</em></em>*</p>
<p><em>*__-</em>-</p>
<p><em>*xx-</em>-</p>
````````````````````````````````

#277:
```````````````````````````````` example
```language-r
x <- 1
```

```r
x <- 1
```
.
<pre><code class="language-r">x &lt;- 1
</code></pre>
<pre><code class="language-r">x &lt;- 1
</code></pre>
````````````````````````````````

#278
```````````````````````````````` example
&parag;

&para

&para;
.
<p>&amp;parag;</p>
<p>&amp;para</p>
<p>¶</p>
````````````````````````````````

#281
```````````````````````````````` example
[test]:example
""third [test]
.
<p>&quot;&quot;third <a href="example">test</a></p>
````````````````````````````````

#283
```````````````````````````````` example
x<!x>

x<!>
.
<p>x<!x></p>
<p>x&lt;!&gt;</p>
````````````````````````````````

#285
```````````````````````````````` example
foo <!-- test --->

foo <!-- test ---->

foo <!----->

foo <!-- test --> more -->
.
<p>foo <!-- test ---></p>
<p>foo <!-- test ----></p>
<p>foo <!-----></p>
<p>foo <!-- test --> more --&gt;</p>
````````````````````````````````
