quarto-revealjs-codewindow icon indicating copy to clipboard operation
quarto-revealjs-codewindow copied to clipboard

code-line-numbers overwriting in code window

Open edenian-prince opened this issue 2 years ago • 1 comments
trafficstars

Hi @EmilHvitfeldt - i'm loving the code windows!

I found a potential bug when using code-line-numbers in a code window. When I specify which lines to highlight the previously highlighted lines do not un-highlight (they still have the same alpha/transparency).

Here's an example qmd. The first chunk with the code window and the second with a regular code block, both with code-line-numbers:

---
title: "check"
format: revealjs
echo: true
revealjs-plugins:
  - codewindow
knitr: true
---

using `code-line-numbers: "|1-5"`

:::{.codewindow width="500px"}
script.r
```{sass eval=FALSE}
#| code-line-numbers: "|1-5"
library(tidyverse)
mtcars %>%
  arrange(desc(modification_time)) %>%
  slice(1) %>%
  pull(mpg)

fs::dir_info(here::here()) %>%
  arrange(desc(modification_time)) %>%
  slice(1) %>%
  pull(path) %>%
  readr::read_csv
```

:::

# regular code block - this works
using `code-line-numbers: "|1-5"`

```{r}
#| eval: false
#| code-line-numbers: "|1-5"
library(tidyverse)
mtcars %>%
  arrange(desc(modification_time)) %>%
  slice(1) %>%
  pull(mpg)

fs::dir_info(here::here()) %>%
  arrange(desc(modification_time)) %>%
  slice(1) %>%
  pull(path) %>%
  readr::read_csv
  
```

edenian-prince avatar Sep 07 '23 19:09 edenian-prince

adding screen shots-

Here's with the code window:

Screen Shot 2023-09-07 at 12 34 15 PM

Screen Shot 2023-09-07 at 12 34 21 PM

And a regular code block with the expected result:

Screen Shot 2023-09-07 at 12 34 27 PM

Screen Shot 2023-09-07 at 12 34 33 PM

edenian-prince avatar Sep 07 '23 19:09 edenian-prince