### Bug description

Example document:

```
---
title: "Test"
format:
  html:
    theme: cosmo
  pdf:
    indent: true
    keep-tex: true
---


1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tempus iaculis
   interdum.

    ```{r fig-test}
    #| echo: false
    #| fig-cap: Ducks.
    library(ggplot2)
    ggplot(cars, aes(x = speed, y = dist)) +
      geom_point()
    ```

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tempus iaculis
    interdum.
2. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tempus iaculis
   interdum.

```

When rendered, the chunk appears incorrectly and without its caption:

![Screen Shot 2022-09-22 at 10 26 18 AM](https://user-images.githubusercontent.com/711629/191773889-90f51fcc-4078-457b-bf13-f21154a20fd0.png)

However, if I make the code block indented by three spaces instead of four, the figure renders perfectly with its caption and numbering.

This seems to only affect the code chunk -- the subsequent sentence renders just fine. Perhaps with four-space indentation the output is incorrectly being treated as verbatim code? But it's not displayed in a verbatim block, so I don't know.

This is on macOS, with:

```
$ quarto --version
1.1.251
```

### 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-09-22T14:28:54Z
capnrefsmmat
invalid
closed
Code blocks inside lists mis-rendered, depending on indentation
https://github.com/quarto-dev/quarto-cli/issues/2555