xaringan icon indicating copy to clipboard operation
xaringan copied to clipboard

Code highlighting does not work when prompt=TRUE

Open matthiasgomolka opened this issue 5 years ago • 0 comments

I noticed that code highlighting does not work when the chunk option prompt = TRUE is set. Here is an MWE:

---
output:
  xaringan::moon_reader:
    lib_dir: libs
    nature:
      highlightLines: true
---

```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(eval = FALSE)
```

```{r with prompt, prompt=TRUE}
{{highlight == FALSE}}
```

```{r without prompt, prompt=FALSE}
{{highlight == TRUE}}
```

This seems to stem from the prompt character > not being taken into account before evaluating the highlighting.

matthiasgomolka avatar Mar 12 '19 09:03 matthiasgomolka