### Bug description

Quarto 1.0.28 is not finding a variable used in a caption. The error message is "object 'spe' not found".  Here's a reproducible example:

---
title: "Test Report"
date: "`r Sys.Date()`"
toc: true
toc-depth: 4
format:
  html:
    code-tools: true
    code-fold: true
    code-link: false
---

# A Section

```{r}
spe <- 0.03
```

```{r}
#| label: fig-test
#| fig-cap: !expr paste('The lower left plot contains raw data (Spearman $\\rho=',spe[1],'$)')
plot(1:10)
```
I'm running Ubuntu 22.04

### `quarto check` Output

_No response_

### `quarto tools check` Output

```bash
[✓] Checking Quarto installation......OK
      Version: 1.0.28
      Path: /opt/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.4
      Path: /usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /usr/lib/R
      LibPaths:
        - /home/harrelfe/R/x86_64-pc-linux-gnu-library/4.2
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      rmarkdown: 2.11

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


### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included 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] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [ ] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-07-18T13:38:56Z
harrelfe
bug
Future
open
Quarto not finding a variable used in a capton
https://github.com/quarto-dev/quarto-cli/issues/1447