Skip to content

YAML parameters being interpreted as R and giving unhelpful error messages #1189

@plukethep

Description

@plukethep

Bug description

I believe you can put R commands into chunk paramters, this is useful but does give issues when you miss out a space. E.g.

---
title: "test"
---

```{r}
#| warning: false
#| eval:false
```

Which gives the error:

processing file: test.rmarkdown
Error in yaml::yaml.load(yaml, eval.expr = TRUE) :
Scanner error: while scanning a simple key at line 2, column 1 could not find expected ':' at line 3, column 1
Calls: .main ... parse_block -> partition_yaml_options ->
Execution halted

I presume that this is because the eval:false line is being interpreted as R rather than YAML, but the error message isn't helpful and had me messing with the top YAML as it didn't mention when code chunk it was referring to.

Strangely, dropping the warning line fixes things:

---
title: "test"
---

```{r}
#| eval:false
```

RStudio: 2022.02.3 Build 492
Windows

Checklist

  • formatted your issue so it is easier for us to read?
  • included a minimal, self-contained, and reproducible example?
  • documented the quarto version you're running, by providing the output produced by quarto check in a terminal in your issue?
  • documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • documented which operating system you're running? If on Linux, please provide the specific distribution as well.
  • upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingyaml-validationIssues with YAML validation and autocompletion in quarto

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions