quarto-dev / quarto-dev/quarto-cli

YAML parameters being interpreted as R and giving unhelpful error messages

Open
#1,189 1 comment 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Jun 20, 2022.

bug yaml-validation
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.