Open zkamvar opened 1 year ago
I just found a fun wrinkle: R chunk options that contain backticks cannot be parsed by {commonmark}, and thus {tinkr}:
test <- r"{ ```{r, fig.cap = "caption with `backticks`"} code block ```}" commonmark::markdown_xml(test) |> 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">```{r, fig.cap = "caption with </text> #> <code xml:space="preserve">backticks</code> #> <text xml:space="preserve">"}</text> #> <softbreak /> #> <text xml:space="preserve">code block</text> #> </paragraph> #> <code_block xml:space="preserve"></code_block> #> </document>
Created on 2023-02-15 with reprex v2.0.2
I don't think there is much to be done about this because R Markdown is a superset of commonmark, so it's not expected to fully parse correctly in the first place.
I just found a fun wrinkle: R chunk options that contain backticks cannot be parsed by {commonmark}, and thus {tinkr}:
Created on 2023-02-15 with reprex v2.0.2
I don't think there is much to be done about this because R Markdown is a superset of commonmark, so it's not expected to fully parse correctly in the first place.