### Bug description

Hello, 

# Current situation

{knitr} has a recent update to v1.43 that makes rendering of R code chunks with htmlwidgets fails with
```bash
$ quarto render Reprex.Rmd 


processing file: Reprex.Rmd
1/5                
2/5 [setup]        
3/5                
4/5 [DT htmlwidget]

Quitting from lines 15-16 [DT htmlwidget] (Reprex.Rmd)
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
```

This is not specific to {DT}, but also occurs with other htmlwidgets related packages : {collapsibleTree}, ...

# ReprEx

Reprex.qmd is the following (code chunk separator manually edited for correct rendering here): 
```qmd
---
title: "ReprEx htmlwidget"
format: html
---

``{r setup}
library(DT)
xfun::session_info('knitr')
``

``{r DT htmlwidget}
datatable(iris)
``
```


# Workaround

Downgrading {knitr} to 1.42 workaround the problem : 

## same rendering result with knitr 1.42
```bash
$ quarto render Reprex.qmd 


processing file: Reprex.qmd
                                                                                                          
output file: Reprex.knit.md

pandoc 
  to: html
  output-file: Reprex.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png
  
metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  title: ReprEx htmlwidget
  
Output created: Reprex.html
$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.353
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.8.16 (Conda)
      Path: /usr/local/Caskroom/miniconda/base/envs/r-reticulate/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2/Resources/library
      knitr: 1.42
      rmarkdown: 2.21

[✓] Checking Knitr engine render......OK
```

# Session Info
## quarto version
```bash
$ quarto -V
1.3.353
```
## Rstudio version 

Rstudio version ( as it also occurs in Rstudio ) : RStudio 2023.03.1+446 "Cherry Blossom" Release (6e31ffc3ef2a1f81d377eeccab71ddc11cfbd29e, 2023-05-09) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.03.1+446 Chrome/108.0.5359.179 Electron/22.0.3 Safari/537.36

## quarto check
```bash
$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.353
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.8.16 (Conda)
      Path: /usr/local/Caskroom/miniconda/base/envs/r-reticulate/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2/Resources/library
      knitr: 1.43
      rmarkdown: 2.21

[✓] Checking Knitr engine render......OK
```



### 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.
- [X] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
2023-05-26T10:31:00Z
cregouby
bug needs-discussion backport knitr
Hot-fix
closed
Quarto fails to render htmlwidgets when running {knitr} 1.43 with Error in `add_html_caption()`:
https://github.com/quarto-dev/quarto-cli/issues/5702