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

[Bug report] Double backticks for inline code breaks new remark-slide command #272

Open
3 tasks done
anna-doizy opened this issue Jul 30, 2020 · 4 comments
Open
3 tasks done

Comments

@anna-doizy
Copy link

Hi,

Somehow, when double backticks (``) surround inline code (eg to put single ` in it), the --- command is not recognized as new slide instruction anymore.
Anyway, I have found a less elegant html workaround.
I was thinking that it could be possible to fix, but it overtakes my skills by far. I'm not even sure whether it is a xaringan or a remark issue.

Here is a reproducible chunk:

---
title: "Backticks issue"
output: xaringan::moon_reader
---
This will break the next slide(s): `` `5` <- "ananas" ``.

---
It seems to be difficult to use `knitr::inline_expr()` in this case.

---
This will work fine: <code>\`5\` <- "ananas"</code>.

---
Something smart here.

Thank you for reading me!
Cheers,
Anna

PS: such a great package - again, thanks!

Session info
xfun::session_info('xaringan')
#> R version 4.0.2 (2020-06-22)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 8.1 x64 (build 9600)
#> 
#> Locale:
#>   LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252   
#>   LC_MONETARY=French_France.1252 LC_NUMERIC=C                  
#>   LC_TIME=French_France.1252    
#> 
#> Package version:
#>   base64enc_0.1.3 BH_1.72.0.3     digest_0.6.25   evaluate_0.14  
#>   glue_1.4.1      graphics_4.0.2  grDevices_4.0.2 highr_0.8      
#>   htmltools_0.5.0 httpuv_1.5.4    jsonlite_1.7.0  knitr_1.29     
#>   later_1.1.0.1   magrittr_1.5    markdown_1.1    methods_4.0.2  
#>   mime_0.9        promises_1.1.1  R6_2.4.1        Rcpp_1.0.5     
#>   rlang_0.4.7     rmarkdown_2.3   servr_0.18      stats_4.0.2    
#>   stringi_1.4.6   stringr_1.4.0   tinytex_0.25    tools_4.0.2    
#>   utils_4.0.2     xaringan_0.16   xfun_0.16       yaml_2.2.1

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('xaringan'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/xaringan').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@hollina
Copy link

hollina commented Jul 14, 2021

I had nearly this exact same issue. It was driving me nuts. Thanks for the simple workaround. Hadn't thought of that.

@cderv
Copy link
Collaborator

cderv commented Jul 15, 2021

FWIW I think this is an issue with remark.js parser and double backticks. The Markdown code is correctly written asis by xaringan in the HTML to be processed by remark.js

I don't know if double backticks syntax is currently supported by remark. But they surely seem to break the --- slide delimiter.

Maybe we should open an issue there ? 🤔 Did you already ?

@anna-doizy
Copy link
Author

Hi @cderv ,
Thanks for your interest. I didn't, as I have no clue about how to rephrase my initial issue. I don't know enough js to be sure that I'll be understood and to produce a reprex...
I would be grateful if you would take the time to do so.
However, as we've got the workaround, I don't think that it is an emergency ;-)

Thanks again anyway!

@pat-s
Copy link
Collaborator

pat-s commented Aug 27, 2021

As a workaround you can build (sadly there is no direct download) a static version of remark.min.js and set it within your Rmd:

  xaringan::moon_reader:
    chakra: "path/to/remark.min.js"

To build remark.min.js from a commit in January 2021 (randomly selected), you can do the following

git clone https://github.com/gnab/remark.git
cd remark
git reset --hard c69c25fa94c45ac8bfa668bee1d878e86517f93a
git submodule update --init --recursive
npm install
node make

Then copy out/remark.min.js to the desired location. This requires a working node installation on your machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants