### Bug description

Any content *before* the first Markdown header in a chapter is moved *past* this header when rendered.

## Minimal reproducible example:

1. Create a [new book project](https://quarto.org/docs/books/index.html#quick-start):

   ```sh
   quarto create-project mybook --type book
   ```

2. Edit the file `mybook/references.qmd` to have the following content:

    ````md
    ```{=tex}
    \clearpage
    \newpage
    \listoffigures
    \newpage
    \listoftables
    \newpage
    ```
    
    # References {.unnumbered}
    
    ::: {#refs}
    :::
    
    ````

3. Render/preview the book:

   ```sh
   quarto preview mybook
   ```

## Expected result

The default output of a new book project **plus** (in PDF output only) a list of figures and a list of tables immediately *before* the bibliography.

## Actual result

As you will see, the page with the *References* heading will be empty, followed by a page with the list of figures and a page with the list of tables, followed by the bibliography content (the `::: {#refs}` block).

## System details

- Quarto 1.2.280 (issue is also present in latest pre-release v1.3.56)
- Latest TinyTeX providing `XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex)`
- Ubuntu 20.04


### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
2022-12-15T20:00:37Z
salim-b
bug wontfix
closed
Content *before* first MD header in chapter is moved *past* the header
https://github.com/quarto-dev/quarto-cli/issues/3681