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
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.
I'm using Windows 10 and the following version of RStudio:
Checklist