### Bug description

**Context,** my current workflow is to have a QMD that analyses a model fit using only the fit object.
This is then pulled into a application specific report using `knitr::knit_child`.

**Issue** is that the table of contents (TOC) is missing subsections if the child report has n > 1 subsections.

See the TOC in the following reproducible example.

````
---
format: html
keep-md: true
toc: true
toc-depth: 3
number-sections: true
---

```{r setup}
#| include: false
include_child <- function(n) {
  txt <- paste(
    sprintf("### H3 (Child) - %s\nSome content\n", seq(n), seq(n)),
    collapse = "\n"
  )
    
  res <- knitr::knit_child(text = txt, quiet = TRUE)
  return(res)
}
```

## Good

Section appears in TOC.

```{r}
#| echo: false
#| results: asis
cat(include_child(n = 1))
```

## Bad

No sections appears in TOC.

```{r}
#| echo: false
#| results: asis
cat(include_child(n = 2))
```
````

I'm using Windows 10 and the following version of RStudio:
> RStudio 2022.07.2+576 "Spotted Wakerobin" Release (e7373ef832b49b2a9b88162cfe7eac5f22c40b34, 2022-09-06) for Windows
> Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

### 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.
cscheid
2022-11-04T18:36:18Z
nclJoshCowley
bug crossref
v1.4
open
TOC ignoring subsections from child document
https://github.com/quarto-dev/quarto-cli/issues/3178