### Bug description

I've noticed, the Frontmatter/YAML parser seems to act funny when multiple new lines are inserted between entries, or well anywhere in the frontmatter.

When only one new line between entries is used, the parser detects the `pdf` format automatically.


### Steps to reproduce

- **Working Version**: Compile the following document

```qmd
---
title: "Untitled"

format:
  pdf:
    pdf-engine: pdflatex
---

hello world
```

- **Breaking Behaviour**: Add a new line directly after `---` in the frontmatter

```qmd
---

title: "Untitled"

format:
  pdf:
    pdf-engine: pdflatex
---

hello world
```

- **Breaking Behaviour**: Add double new lines anywhere in the frontmatter


```qmd
---
title: "Untitled"


format:


  pdf:
    pdf-engine: pdflatex


---

hello world
```

### Expected behavior

Compile the document correctly using the given format (in this case being `pdf`).

![image](https://github.com/quarto-dev/quarto-cli/assets/41155337/57ee3382-86e4-4cc0-8e88-b0b0476e283e)


### Actual behavior

![image](https://github.com/quarto-dev/quarto-cli/assets/41155337/88fe2904-cfca-484c-a0ec-da8c646426a6)

Following also breaks the expected behaviour

```qmd
---

title: "Untitled"

format: 
  pdf:
    pdf-engine: pdflatex
---
```

```qmd
---
title: "Untitled"


format: 
  pdf:
    pdf-engine: pdflatex

---
```

```qmd
---
title: "Untitled"
format:


  pdf:
    pdf-engine: pdflatex
---
```

### Your environment

- IDE: VSCode
- OS: Windows 10

### Quarto check output

```bash
$ quarto check

[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.3.433
      Path: C:\Users\Joel\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.10.5
      Path: C:/Users/Joel/AppData/Local/Programs/Python/Python310/python.exe     
      Jupyter: 5.1.1
      Kernels: python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.2.2
      Path: C:/PROGRA~1/R/R-42~1.2
      LibPaths:
        - C:/Users/Joel/AppData/Local/R/win-library/4.2
        - C:/Program Files/R/R-4.2.2/library
      knitr: 1.41
      rmarkdown: 2.20

[>] Checking Knitr engine render......OK
```
2023-06-27T16:21:05Z
joelvonrotz
bug
v1.4
closed
Multiple new lines between entries in the frontmatter "breaks" the parser when rendering
https://github.com/quarto-dev/quarto-cli/issues/6042