### Bug description

When I add the lines
```{python}
#| label: fig-density
#| fig-cap: "Plots of the probability density function for $\mu$ = 10" 
```
in a `{python}` block, then render my project with VSCode (`❯ quarto preview /path/to/project --render all --no-browser --no-watch-inputs`), I get the error

```
Rendering:
ERROR: YAMLException: unknown escape sequence (undefined, 3:59)
3: fig-cap: "Plots of the probability density function for $\mu$ = 10" 
```
which is somehow caused by having the math environment in the caption. Is there a simple way around this? I couldn't find anything in the docs.

Quarto 1.0.38, MacOS Monterey 12.5.1, M1 MacBook Air

### 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-23T13:19:47Z
phinate
bug
closed
"Unknown escape sequence" error when rendering dollar sign math syntax in figure caption
https://github.com/quarto-dev/quarto-cli/issues/2576