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

code-line-numbers overwriting in code window #2

Open
edenian-prince opened this issue Sep 7, 2023 · 1 comment
Open

code-line-numbers overwriting in code window #2

edenian-prince opened this issue Sep 7, 2023 · 1 comment

Comments

@edenian-prince
Copy link

edenian-prince commented Sep 7, 2023

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant