Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed https://markdown-it.github.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

274 lines
2.7 KiB

Issue #55:
.
![test]
![test](foo bar)
.
<p>![test]</p>
<p>![test](foo bar)</p>
.
Issue #35. `<` should work as punctuation
.
an **(:**<br>
.
<p>an <strong>(:</strong><br></p>
.
Should unescape only needed things in link destinations/titles:
.
[test](<\f\o\o\>\\>)
[test](foo "\\\"\b\a\r")
.
<p><a href="%5Cf%5Co%5Co%3E%5C">test</a></p>
<p><a href="foo" title="\&quot;\b\a\r">test</a></p>
.
Not a closing tag
.
</ 123>
.
<p>&lt;/ 123&gt;</p>
.
Escaping entities in links:
.
[](<&quot;> "&amp;&ouml;")
[](<\&quot;> "\&amp;\&ouml;")
[](<\\&quot;> "\\&quot;\\&ouml;")
.
<p><a href="%22" title="&amp;ö"></a></p>
<p><a href="&amp;quot;" title="&amp;amp;&amp;ouml;"></a></p>
<p><a href="%5C%22" title="\&quot;\ö"></a></p>
.
Checking combination of replaceEntities and unescapeMd:
.
~~~ &amp;&bad;\&amp;\\&amp;
just a funny little fence
~~~
.
<pre><code class="&amp;&amp;bad;&amp;amp;\&amp;">just a funny little fence
</code></pre>
.
Underscore between punctuation chars should be able to close emphasis.
.
_(hai)_.
.
<p><em>(hai)</em>.</p>
.
Those are two separate blockquotes:
.
- > foo
> bar
.
<ul>
<li>
<blockquote>
<p>foo</p>
</blockquote>
</li>
</ul>
<blockquote>
<p>bar</p>
</blockquote>
.
Regression test (code block + regular paragraph)
.
> foo
> bar
.
<blockquote>
<pre><code>foo
</code></pre>
<p>bar</p>
</blockquote>
.
Don't output empty class here:
.
```&#x20;
test
```
.
<pre><code>test
</code></pre>
.
Coverage. Directive can terminate paragraph.
.
a
<?php
.
<p>a</p>
<?php
.
Coverage. Nested email autolink (silent mode)
.
*<foo@bar.com>*
.
<p><em><a href="mailto:foo@bar.com">foo@bar.com</a></em></p>
.
Coverage. Unpaired nested backtick (silent mode)
.
*`foo*
.
<p><em>`foo</em></p>
.
Coverage. Entities.
.
*&*
*&#x20;*
*&amp;*
.
<p><em>&amp;</em></p>
<p><em> </em></p>
<p><em>&amp;</em></p>
.
Coverage. Escape.
.
*\a*
.
<p><em>\a</em></p>
.
Coverage. parseLinkDestination
.
[foo](<
bar>)
[foo](<bar)
.
<p>[foo](&lt;
bar&gt;)</p>
<p>[foo](&lt;bar)</p>
.
Coverage. parseLinkTitle
.
[foo](bar "ba)
[foo](bar "ba\
z")
.
<p>[foo](bar &quot;ba)</p>
<p><a href="bar" title="ba\
z">foo</a></p>
.
Coverage. Image
.
![test]( x )
.
<p><img src="x" alt="test"></p>
.
.
![test][foo]
[bar]: 123
.
<p>![test][foo]</p>
.
.
![test][[[
[bar]: 123
.
<p>![test][[[</p>
.
.
![test](
.
<p>![test](</p>
.
Coverage. Link
.
[test](
.
<p>[test](</p>
.
Coverage. Reference
.
[
test\
]: 123
foo
bar
.
<p>foo
bar</p>
.
.
[
test
]
.
<p>[
test
]</p>
.
.
> [foo]: bar
[foo]
.
<blockquote></blockquote>
<p><a href="bar">foo</a></p>
.
Coverage. Tabs in blockquotes.
.
> foo
> bar
.
<blockquote>
<pre><code> foo
bar
</code></pre>
</blockquote>
.
Coverage. Tabs in lists.
.
1. foo
bar
.
<ol>
<li>
<p>foo</p>
<pre><code> bar
</code></pre>
</li>
</ol>
.