dbuenzli / cmarkit

CommonMark parser and renderer for OCaml
https://erratique.ch/software/cmarkit
ISC License
46 stars 8 forks source link

Incorrect parsing of code span #21

Open dbuenzli opened 8 months ago

dbuenzli commented 8 months ago
> printf '\```ext``' | cmark             
<p>`<code>ext</code></p>
> printf '\```ext``' | cmarkit html   
<p>```ext``</p>
dbuenzli commented 8 months ago

The escaped backtick logic is wrong, somehow Cmarkit takes an initial escape in a backtick run as disabling the whole run.

We should either change the tokenization strategy or match against count - 1 when the run starts with an escape and textify the escaped backtick. Unclear in my mind right now but we need to be careful about this.