cmark

My personal build of CMark ✏️

why-cmark-and-not-x.md (1590B)

  1 Why use `cmark` and not X?
  2 ==========================
  3 
  4 `hoedown`
  5 ---------
  6 
  7 `hoedown` (which derives from `sundown`) is slightly faster
  8 than `cmark` in our benchmarks (0.21s vs. 0.29s).  But both
  9 are much faster than any other available implementations.
 10 
 11 `hoedown` boasts of including "protection against all possible
 12 DOS attacks," but there are some chinks in the armor:
 13 
 14     % time python -c 'print(("[" * 50000) + "a" + ("]" * 50000))' | cmark
 15     ...
 16     user 0m0.073s
 17     % time python -c 'print(("[" * 50000) + "a" + ("]" * 50000))' | hoedown
 18     ...
 19     0m17.84s
 20 
 21 `hoedown` has many parsing bugs.  Here is a selection (as of
 22 v3.0.3):
 23 
 24     % hoedown
 25     - one
 26       - two
 27         1. three
 28     ^D
 29     <ul>
 30     <li>one
 31 
 32     <ul>
 33     <li>two</li>
 34     <li>three</li>
 35     </ul></li>
 36     </ul>
 37 
 38 
 39     % hoedown
 40     ## hi\###
 41     ^D
 42     <h2>hi\</h2>
 43 
 44 
 45     % hoedown
 46     [ΑΓΩ]: /φου
 47 
 48     [αγω]
 49     ^D
 50     <p>[αγω]</p>
 51 
 52 
 53     % hoedown
 54     ```
 55     [foo]: /url
 56     ```
 57 
 58     [foo]
 59     ^D
 60     <p>```</p>
 61 
 62     <p>```</p>
 63 
 64     <p><a href="/url">foo</a></p>
 65 
 66 
 67     % hoedown
 68     [foo](url "ti\*tle")
 69     ^D
 70     <p><a href="url" title="ti\*tle">foo</a></p>
 71 
 72 
 73     % ./hoedown
 74     - one
 75      - two
 76       - three
 77        - four
 78     ^D
 79     <ul>
 80     <li>one
 81 
 82     <ul>
 83     <li>two</li>
 84     <li>three</li>
 85     <li>four</li>
 86     </ul></li>
 87     </ul>
 88 
 89 
 90 `discount`
 91 ----------
 92 
 93 `cmark` is about six times faster.
 94 
 95 `kramdown`
 96 ----------
 97 
 98 `cmark` is about a hundred times faster.
 99 
100 `kramdown` also gets tied in knots by pathological input like
101 
102     python -c 'print(("[" * 50000) + "a" + ("]" * 50000))'
103 
104