commonmark icon indicating copy to clipboard operation
commonmark copied to clipboard

Any way to flag escaped characters on input?

Open zkamvar opened this issue 1 year ago • 1 comments

commonmark supports both bare square brackets and escaped square brackets. When the enter the parser, there's no indication which set of brackets were escaped and which ones were bare:

commonmark::markdown_xml("[bare brackets] \\[escaped brackets\\]") |> writeLines()
#> <?xml version="1.0" encoding="UTF-8"?>
#> <!DOCTYPE document SYSTEM "CommonMark.dtd">
#> <document xmlns="http://commonmark.org/xml/1.0">
#>   <paragraph>
#>     <text xml:space="preserve">[bare brackets] [escaped brackets]</text>
#>   </paragraph>
#> </document>

Created on 2022-09-19 with reprex v2.0.2

Is there a way to have the parser indicate which characters were escaped in the source document?

zkamvar avatar Sep 19 '22 23:09 zkamvar

You would have to ask upstream in https://github.com/commonmark/cmark

jeroen avatar Sep 20 '22 14:09 jeroen