cmarkit
cmarkit copied to clipboard
CommonMark renderer doesn't escape tilde before strikethrough
Thank you for this great library.
utop # Cmarkit.Doc.of_string ~strict:false {|\~~~strike~~|} |> print_doc;;
Paragraph:
Inlines:
Text: '~'
Strikethrough:
Text: 'strike'
- : unit = ()
utop # Cmarkit.Doc.of_string ~strict:false {|\~~~strike~~|} |> Cmarkit_commonmark.of_doc;;
- : string = "~~~strike~~"
However, three tildes indicates the start of a fenced code block: commonmark.js preview. Reporting it here since it's not included in the known incorrect renderings list.
Thanks.
Maybe the simplest is to unconditionally add ~ the set of characters that are unconditionally escaped at the start (first bullet here).
I suspect the same must be done for ` but I found another bug to be resolved first https://github.com/dbuenzli/cmarkit/issues/21