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

known issue: commonmark cannot parse code chunk options with backtics #89

Open
zkamvar opened this issue Feb 15, 2023 · 0 comments
Open
Labels
wontfix This will not be worked on

Comments

@zkamvar
Copy link
Member

zkamvar commented Feb 15, 2023

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 = &quot;caption with </text>
#>     <code xml:space="preserve">backticks</code>
#>     <text xml:space="preserve">&quot;}</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.

@zkamvar zkamvar added the wontfix This will not be worked on label Feb 15, 2023
@zkamvar zkamvar changed the title known issue: commonmark cannot parse code chunks with backtics known issue: commonmark cannot parse code chunks with backticks Feb 15, 2023
@zkamvar zkamvar changed the title known issue: commonmark cannot parse code chunks with backticks known issue: commonmark cannot parse code chunk options with backtics Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant