r-lib / commonmark

High Performance CommonMark and Github Markdown Rendering in R
https://docs.ropensci.org/commonmark/
Other
88 stars 11 forks source link

subscript text is converted to strikethrough #25

Closed zkamvar closed 1 year ago

zkamvar commented 1 year ago

I noticed this in https://github.com/ropensci/tinkr/issues/99, but subscript text (at least with pandoc markdown) is converted to strikethrough (with two ~) on roundtrip between markdown -> XML -> markdown

commonmark::markdown_commonmark("H~2~O", extensions = TRUE)
#> [1] "H~~2~~O\n"

Created on 2023-08-18 with reprex v2.0.2

jeroen commented 1 year ago

This looks like a bug in cmark, can you report in in https://github.com/github/cmark-gfm ?

zkamvar commented 1 year ago

It appears that this is a feature, not a bug 😞: https://github.com/github/cmark-gfm/issues/71#issuecomment-373170209

jeroen commented 1 year ago

Ok so there is nothing i can do :/

zkamvar commented 4 months ago

It turns out there was a fix for this and that was to set the CMARK_OPT_STRIKETHROUGH_DOUBLE_TILDE option. I've opened #31 to address it.