Skip to content

code-line-numbers overwriting in code window #2

Open
@edenian-prince

Description

@edenian-prince

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
  
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions