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

Multi line string highlighting is not correct #356

Open
cderv opened this issue Jul 4, 2022 · 4 comments
Open

Multi line string highlighting is not correct #356

cderv opened this issue Jul 4, 2022 · 4 comments

Comments

@cderv
Copy link
Collaborator

cderv commented Jul 4, 2022

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.

@yihui
Copy link
Owner

yihui commented Jul 5, 2022

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).

@cderv
Copy link
Collaborator Author

cderv commented Jul 6, 2022

So maybe this is an issue to raise in remark.js for their embeded highlight.js version ?

@cderv cderv added the remark.js label Jul 6, 2022
@yihui
Copy link
Owner

yihui commented Jul 6, 2022

Yes, I think so. I'm not sure if the latest version of remark.js (currently 0.15.0) has fixed it.

@cderv
Copy link
Collaborator Author

cderv commented Jul 6, 2022

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.

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

2 participants