### Bug description

Rendering document which includes `#| tbl-cap` and `datatable` still results in error, even after #5704 .
Tested with most recent dev versions of quarto-cli and knitr.

### Steps to reproduce

````qmd
---
title: "Untitled"
subtitle: "PA2"
date: 2023-05-31
author: Me
toc: true
toc-location: left
toc-depth: 6
number-sections: true
number-depth: 6
format:
  html:
    page-layout: article
    margin-top: 2cm
    margin-bottom: 2cm
    html-math-method: katex
    code-tools: false
    self-contained: true
    smooth-scroll: true
editor: visual
execute:
  echo: false
  warning: false
  error: false
  fig-height: 6
  fig-width: 8
  fig-align: center
  fig-pos: "h"
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

## Running Code

When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r global_options, include=FALSE}
knitr::opts_chunk$set(fig.pos = 'h', echo=FALSE, warning=FALSE, message=FALSE, error=FALSE, fig.width=8, fig.height=6, fig.align='center')
options(xtable.comment = FALSE)
# options(knitr.table.format = "html")
options(kableExtra.latex.load_packages = FALSE)
```

```{r}
library(DT)
```

You can add options to executable code like this

```{r table}
#| column: screen-inset-right
#| tbl-cap: "Table caption"

mtcars %>% 
    datatable(extensions = 'Buttons', 
              filter = 'top',
              rownames= FALSE,
              options = list(dom = 'Blfrtip',
                             buttons = c('copy', 'csv', 'excel', 'pdf'),
                             lengthMenu = list(c(10,25,50,-1),
                                               c(10,25,50,"All"))))
```

The `echo: false` option disables the printing of code (only output is displayed).
````

### Expected behavior

Successful rendering

### Actual behavior

```
Quitting from lines 53-64 [table] (ReprEx.qmd)
Error in `add_html_caption()`:
! unused argument (xfun::grep_sub("^[^<]*<[^>]+aria-labelledby[ ]*=[ ]*\"([^\"]+)\".*$", "\\1", x))
Backtrace:
  1. global .main()
  2. execute(...)
  3. rmarkdown::render(...)
  4. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  5. knitr:::process_file(text, output)
     ...
 14. sew(res, options)
 15. knitr:::sew.list(x, options, ...)
 16. base::lapply(x, sew, options, ...)
 17. FUN(X[[i]], ...)
 18. knitr:::sew.knit_asis(x, options, ...)
Execution halted
```

### Your environment

_No response_

### Quarto check output

```
[✓] 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: 99.9.9
      Path: /Users/emamusi/Documents/quarto-cli/package/dist/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.15 (Conda)
      Path: /Users/emamusi/miniforge3/bin/python
      Jupyter: 5.1.3
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.0
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.43.1
      rmarkdown: 2.21

[✓] Checking Knitr engine render......OK
```
2023-05-31T08:02:27Z
marioem
duplicate
closed
Error in `add_html_caption()`: ! unused argument (xfun::grep_sub("^[^<]*<[^>]+aria-labelledby[ ]*=[ ]*\"([^\"]+)\".*$", "\\1", x))
https://github.com/quarto-dev/quarto-cli/issues/5762