2015-12-04 07:49:05 +00:00
|
|
|
Why use `cmark` and not X?
|
|
|
|
==========================
|
|
|
|
|
|
|
|
`hoedown`
|
|
|
|
---------
|
|
|
|
|
|
|
|
`hoedown` (which derives from `sundown`) is slightly faster
|
|
|
|
than `cmark` in our benchmarks (0.21s vs. 0.29s). But both
|
|
|
|
are much faster than any other available implementations.
|
|
|
|
|
|
|
|
`hoedown` boasts of including "protection against all possible
|
|
|
|
DOS attacks," but there are some chinks in the armor:
|
|
|
|
|
|
|
|
% time python -c 'print(("[" * 50000) + "a" + ("]" * 50000))' | cmark
|
|
|
|
...
|
|
|
|
user 0m0.073s
|
|
|
|
% time python -c 'print(("[" * 50000) + "a" + ("]" * 50000))' | hoedown
|
|
|
|
...
|
|
|
|
0m17.84s
|
|
|
|
|
2015-12-13 16:20:42 +00:00
|
|
|
`hoedown` has many parsing bugs. Here is a selection (as of
|
|
|
|
v3.0.3):
|
2015-12-04 07:49:05 +00:00
|
|
|
|
|
|
|
% hoedown
|
|
|
|
- one
|
|
|
|
- two
|
|
|
|
1. three
|
|
|
|
^D
|
|
|
|
<ul>
|
|
|
|
<li>one
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>two</li>
|
|
|
|
<li>three</li>
|
|
|
|
</ul></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
% hoedown
|
|
|
|
## hi\###
|
|
|
|
^D
|
|
|
|
<h2>hi\</h2>
|
|
|
|
|
|
|
|
|
|
|
|
% hoedown
|
|
|
|
[ΑΓΩ]: /φου
|
|
|
|
|
|
|
|
[αγω]
|
|
|
|
^D
|
|
|
|
<p>[αγω]</p>
|
|
|
|
|
|
|
|
|
|
|
|
% hoedown
|
|
|
|
```
|
|
|
|
[foo]: /url
|
|
|
|
```
|
|
|
|
|
|
|
|
[foo]
|
|
|
|
^D
|
|
|
|
<p>```</p>
|
|
|
|
|
|
|
|
<p>```</p>
|
|
|
|
|
|
|
|
<p><a href="/url">foo</a></p>
|
|
|
|
|
|
|
|
|
|
|
|
% hoedown
|
|
|
|
[foo](url "ti\*tle")
|
|
|
|
^D
|
|
|
|
<p><a href="url" title="ti\*tle">foo</a></p>
|
|
|
|
|
|
|
|
|
2015-12-13 16:20:42 +00:00
|
|
|
% ./hoedown
|
|
|
|
- one
|
|
|
|
- two
|
|
|
|
- three
|
|
|
|
- four
|
|
|
|
^D
|
|
|
|
<ul>
|
|
|
|
<li>one
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>two</li>
|
|
|
|
<li>three</li>
|
|
|
|
<li>four</li>
|
|
|
|
</ul></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
2015-12-04 07:49:05 +00:00
|
|
|
`discount`
|
|
|
|
----------
|
|
|
|
|
|
|
|
`cmark` is about six times faster.
|
|
|
|
|
|
|
|
`kramdown`
|
|
|
|
----------
|
|
|
|
|
|
|
|
`cmark` is about a hundred times faster.
|
|
|
|
|
|
|
|
`kramdown` also gets tied in knots by pathological input like
|
|
|
|
|
|
|
|
python -c 'print(("[" * 50000) + "a" + ("]" * 50000))'
|
|
|
|
|
|
|
|
|