### Bug description

Quarto fails when `x` in `knitr::asis_output(x)` has `length(x) != 1`.

See PR #5505 for a solution.

#### Minimal reproducible example

Example qmd:

````md
---
title: Fix asis_output
format: html
engine: knitr
---

`asis_output` with one string:

```{r}
knitr::asis_output("* one\n* two")
```

`asis_output` with two strings:

```{r}
knitr::asis_output(c("* one\n", "* two\n"))
```

`asis_output` with zero strings:
```{r}
knitr::asis_output(character(0))
```
````

The second codeblock generates a warning:

    In grepl("^<\\w+[ >]", x) && grepl("<\\/\\w+>\\s*$", x) :
      'length(x) = 2 > 1' in coercion to 'logical(1)'

While the third codeblock produces an error:

    Error in if (grepl("^<\\w+[ >]", x) && grepl("<\\/\\w+>\\s*$", x) && !grepl("^<div class=\"kable-table\">",  : 
      missing value where TRUE/FALSE needed
    Calls: .main ... sew -> <Anonymous> -> lapply -> FUN -> wrap_asis_output


<details><summary>Command output</summary>

    $ quarto render demo_qmd.qmd
    
    
    processing file: demo_qmd.qmd
      |....................................................| 100% (unnamed-chunk-3)Quitting from lines 21-22 (demo_qmd.qmd) 
                                                                                                                
    Error in if (grepl("^<\\w+[ >]", x) && grepl("<\\/\\w+>\\s*$", x) && !grepl("^<div class=\"kable-table\">",  : 
      missing value where TRUE/FALSE needed
    Calls: .main ... sew -> <Anonymous> -> lapply -> FUN -> wrap_asis_output
    In addition: Warning message:
    In grepl("^<\\w+[ >]", x) && grepl("<\\/\\w+>\\s*$", x) :
      'length(x) = 2 > 1' in coercion to 'logical(1)'
    Execution halted

</details>

#### Expected output

I expect the intermediary markdown to look like this (but then in html and not in markdown):

<details><summary>demo_qmd.md</summary>

````md
# Fix asis_output

`asis_output` with one string:

```{r}
knitr::asis_output("* one\n* two")
```

* one
* two

`asis_output` with two strings:

```{r}
knitr::asis_output(c("* one\n", "* two\n"))
```

* one
* two

`asis_output` with zero strings:
```{r}
knitr::asis_output(character(0))
```
````

</details>

#### Comparison to Rmarkdown

With RMarkdown, this code works just fine:

<details><summary>demo_rmd.Rmd</summary>

````md
---
title: Fix asis_output
output:
  html_document
---

`asis_output` with one string:

```{r}
knitr::asis_output("* one\n* two")
```

`asis_output` with two strings:

```{r}
knitr::asis_output(c("* one\n", "* two\n"))
```

`asis_output` with zero strings:
```{r}
knitr::asis_output(character(0))
```
````
</details>

<details><summary>Command output</summary>

    $ Rscript -e 'rmarkdown::render("demo_rmd.Rmd")'
    
    
    processing file: demo_rmd.Rmd
                                                                                                                
    output file: demo_rmd.knit.md
    
    /usr/bin/pandoc +RTS -K512m -RTS demo_rmd.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output demo_rmd.html --lua-filter /home/rcannood/R/x86_64-redhat-linux-gnu-library/4.2/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/rcannood/R/x86_64-redhat-linux-gnu-library/4.2/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --section-divs --template /home/rcannood/R/x86_64-redhat-linux-gnu-library/4.2/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /tmp/RtmpxfSAAT/rmarkdown-str9883135bff75b.html 
    
    Output created: demo_rmd.html

</details>

### 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.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [ ] Please document the operating system you're running. If on Linux, please provide the specific distribution.
- [ ] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
cderv
2023-05-11T18:55:34Z
rcannood
bug
v1.4
open
Quarto fails when `x` in `knitr::asis_output(x)` has `length(x) != 1`
https://github.com/quarto-dev/quarto-cli/issues/5506