Skip to content

Chunk name is dropped if preceded by a comma #14

@Bisaloo

Description

@Bisaloo
tmpf <- tempfile(fileext = ".Rmd")

input <- c(
  "```{r, test}",
  "plot(cars)",
  "```"
)

cat(input, sep = "\n")
#> ```{r, test}
#> plot(cars)
#> ```

writeLines(
  input,
  tmpf
)

aeolus::unleash(tmpf)

readLines(tmpf) |>
  cat(sep = "\n")
#> ```{r}
#> plot(cars)
#> ```

input <- c(
  "```{r, test, echo = FALSE}",
  "plot(cars)",
  "```"
)

cat(input, sep = "\n")
#> ```{r, test, echo = FALSE}
#> plot(cars)
#> ```

writeLines(
  input,
  tmpf
)

aeolus::unleash(tmpf)

readLines(tmpf) |>
  cat(sep = "\n")
#> ```{r, echo=FALSE}
#> plot(cars)
#> ```

input <- c(
  "```{r test}",
  "plot(cars)",
  "```"
)

cat(input, sep = "\n")
#> ```{r test}
#> plot(cars)
#> ```

writeLines(
  input,
  tmpf
)

aeolus::unleash(tmpf)

readLines(tmpf) |>
  cat(sep = "\n")
#> ```{r test}
#> plot(cars)
#> ```

Created on 2025-08-24 with reprex v2.1.1

Discovered in datacarpentry/R-ecology-lesson#933.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions