Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommonMark renderer doesn't escape tilde before strikethrough #20

Open
tysg opened this issue Mar 13, 2024 · 1 comment
Open

CommonMark renderer doesn't escape tilde before strikethrough #20

tysg opened this issue Mar 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tysg
Copy link

tysg commented Mar 13, 2024

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.

@dbuenzli dbuenzli added the bug Something isn't working label Mar 13, 2024
@dbuenzli
Copy link
Owner

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 #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants