### Bug description

👋  thank you _so_ much for this project. I am so grateful to be using it. 

Something that is very handy is to iterate through a variable and then dynamically create tabs based on values of that variable (here `sex`). There is some strange interaction with the {gt} package whereby I can only make gt work with `purrr::walk` if I use gt::as_raw_html. However if I just produce a single table outside of `purrr::walk `I don't need `gt::as_raw_html`. Here is the error message I get {gt} does not work:

> Error running filter /Applications/quarto/share/filters/quarto-pre/quarto-pre.lua: ...lications/quarto/share/filters/quarto-pre/quarto-pre.lua:2410: attempt to concatenate a nil value (local 'v') stack traceback: ...lications/quarto/share/filters/quarto-pre/quarto-pre.lua:2417: in function <...lications/quarto/share/filters/quarto-pre/quarto-pre.lua:2415>

## editor info
I can reproduce this with RStudio (2022.07.1) and vscode 

## quarto versions tried:
- version 1.1.175
- nightly version
- **This does work on quarto version 1.0.38**


Here is the quarto code to reproduce:

````md
---
title: "Untitled"
format: html
execute:
  warning: false
---

```{r r-pkgs}
library(dplyr)
library(glue)
library(gt)
library(purrr)

## just to simplify
starwars <- starwars %>% 
  filter(!is.na(sex))
```

# Does work

::: {.panel-tabset}

```{r}
#| results: asis

walk(
  unique(starwars$sex), \(hw) {
    cat(glue("## {hw} \n\n"))
    
    starwars %>% 
      filter(sex == hw) %>% 
      count(homeworld) %>% 
      head() %>% 
      gt() %>% 
      as_raw_html() %>% 
      print()
    
    cat("\n\n")
  }
)
```
:::


# Does not work

::: {.panel-tabset}

```{r}
#| results: asis

walk(
  unique(starwars$sex), \(hw) {
    cat(glue("## {hw} \n\n"))
    
    starwars %>% 
      filter(sex == hw) %>% 
      count(homeworld) %>% 
      head() %>% 
      gt() %>% 
      print()
    
    cat("\n\n")
  }
)
```
:::

## single does work
```{r}
#| results: asis
starwars %>% 
  count(homeworld) %>% 
  head() %>% 
  gt()
```
````

```md
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.1 (2022-06-23)
 os       macOS Monterey 12.5
 system   aarch64, darwin20
 ui       RStudio
 ```

### 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.
2022-09-08T22:21:58Z
boshek
documentation tables
v1.3
closed
gt::as_raw_html, purrr::walk and quarto interaction error
https://github.com/quarto-dev/quarto-cli/issues/2370