xaringan
xaringan copied to clipboard
Multi line string highlighting is not correct
From https://community.rstudio.com/t/xaringan-highlight-multi-line-strings-in-a-code-chunk/141311
---
title: "A Minimal Book Example"
output: xaringan::moon_reader
---
# test
```{r, eval = FALSE}
df <- dbGetQuery(con, "SELECT film_id, title, description FROM
film WHERE release_year = 2006")
head(df, 3)
```
I think this is an issue with highlight.js and remark.js.
Not sure if we can tweak something on our side.
BTW This is working correctly for html_document
.
remark.js bundled a version of highlight.js in it, so this is probably not easy to fix. I'm not sure what will happen if we load another version of highlight.js in the document (i.e., whether remark.js will use that version).
So maybe this is an issue to raise in remark.js for their embeded highlight.js version ?
Yes, I think so. I'm not sure if the latest version of remark.js (currently 0.15.0) has fixed it.
There are several changes to highlighting in 0.15 : https://github.com/gnab/remark/blob/c69c25fa94c45ac8bfa668bee1d878e86517f93a/HISTORY.md#015
But I tested like this
---
title: "A Minimal Book Example"
output:
xaringan::moon_reader:
chakra: https://remarkjs.com/downloads/remark-0.15.0.min.js
---
# test
```{r, eval = FALSE}
df <- dbGetQuery(con, "SELECT film_id, title, description FROM
film WHERE release_year = 2006")
head(df, 3)
```
but still get the same results.