### Bug description

The two options below should give the same output but they don't:

- Option 1: Set `echo: fenced` at document level:

````
---
format: html
execute:
  echo: fenced
---

No other chunk options:

```{r}
1 + 1
```

With other chunk options:

```{r}
#| label: addition

1 + 1
```
````

Here is the output for Option 1:

<img width="682" alt="Output of document with source code given above, with annotation showing an empty line at the beginning of the first chunk." src="https://user-images.githubusercontent.com/5965649/177011414-3268746e-a120-49e7-b907-160e1cc6cfd2.png">

- Option 2: Set `echo: fenced` at chunk level:

````
---
format: html
---

No other chunk options:

```{r}
#| echo: fenced

1 + 1
```

With other chunk options:

```{r}
#| echo: fenced
#| label: addition

1 + 1
```
````

Here is the output for Option 2:

<img width="684" alt="Output of document with source code given above" src="https://user-images.githubusercontent.com/5965649/177011447-54840013-f27a-44b7-b569-967991941690.png">

I think the second output looks right, there shouldn't be an empty line in the chunk when no other chunk options are specified.

- Quarto: I'm using dev quarto: 99.9.9 (unfortunately `quarto check` is giving me an error right now)
- RStudio: RStudio 2022.07.0-preview+544 "Spotted Wakerobin" Preview (3a56d20250c52c4b1690d909a00f17e4b4627e54, 2022-06-27) for macOS Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4_0) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36
- OS: macOS 12.4

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, self-contained, and reproducible example?
- [X] documented the quarto version you're running, by providing the output produced by `quarto check` in a terminal in your issue?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-07-02T18:01:56Z
mine-cetinkaya-rundel
bug
closed
Setting echo: fenced at document level yaml creates empty line in chunks with no other options
https://github.com/quarto-dev/quarto-cli/issues/1278