Closed gadenbuie closed 10 months ago
Thanks for catching this @gadenbuie !
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
Issue
When the chunk label is declared using a hashpipe chunk comment option, it becomes a named vector, essentially
$label = c(label = "chunk-label")
.I noticed this because it breaks some assumptions in learnr (see rstudio/learnr#795) that I will fix there, but I think it's worth fixing this inconsistency directly in knitr.
Reprex
Minimal reprex
````markdown --- title: "Label shouldn't be named" output: github_document --- ```{r normal} #| echo: false ``` ```{r} #| label: hash-yaml #| echo: false ``` ```{r} #| hash-knitr, echo = FALSE ``` ```{r} knitr::knit_code$get("normal") knitr::knit_code$get("hash-yaml") knitr::knit_code$get("hash-knitr") ``` ````