### Bug description

Today I was running regression tests, and wanted to produce the results in a Quarto document. I used two packages for the same task: broom and easystats. But there is a difference as far as the cross-referencing is concerned. For the tables generated through broom package, one table doesn't display caption. Instead, I can see "?caption" in its place. But if I use easystats set of packages, I can see the correct captions for both the tables.

The output of quarto check is as follows:


### Steps to reproduce

---
title: "Reprex"
editor: visual
---

In this document, I am trying to capture how quarto treats two packages `broom` and `easystats` differently for the purpose of cross-referencing. I observed that when I have two tables in a single code chunk, arranged in a single column, there is an issue with cross-referencing.

```{r}
library(easystats)
library(broom)
dummy <- data.frame(y = rnorm(100),x = rpois(100,3))
```

Now we can create two regression models from this dummy data.

```{r}
lm_mod1 <- lm(y~x, data = dummy)
lm_mod2 <- lm(x~y, data = dummy)
```

Now let me create two tables using broom

```{r}
#| label: tbl-tables-broom
#| tbl-cap: "Tables using Broom"
#| tbl-subcap: true
#| layout-nrow: 2

lm_mod1 |> broom::tidy()
lm_mod2 |> broom::tidy()

```

And now similarly, using easystats:

```{r}
#| label: tbl-tables-easystats
#| tbl-cap: "Tables using Easystats"
#| tbl-subcap: true
#| layout-nrow: 2

lm_mod1 |> model_parameters() |> display()
lm_mod2 |> model_performance() |> display()
```

### Expected behavior

All the four tables (two generated using broom, and two generated using easystats) should have similar captions.

### Actual behavior

One table generated through broom package shows "?caption" as the caption.

### Your environment

IDE: RStudio 2023.03.1 +446
OS: Windows 10

### Quarto check output

```
quarto check

[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.2: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.163
      Path: C:\Users\Maulik\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

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

[>] Checking Python 3 installation....OK
      Version: 3.11.3
      Path: C:/Program Files/Python311/python.exe
      Jupyter: 5.3.0
      Kernels: python3

(-) Checking Jupyter engine render....0.18s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.3.0
      Path: C:/PROGRA~1/R/R-43~1.0
      LibPaths:
        - C:/Users/Maulik/AppData/Local/R/win-library/4.3
        - C:/Program Files/R/R-4.3.0/library
      knitr: 1.43
      rmarkdown: 2.22

[>] Checking Knitr engine render......OK
```
2023-06-25T11:31:04Z
bhattmaulik
tables knitr
closed
Quarto cross referencing works differently for different packages when a code chunk has multiple tables
https://github.com/quarto-dev/quarto-cli/issues/6023