### Bug description

When using a footnote inside a figure caption, Quarto crashes.

I'm converting a pandoc book to Quarto, and I was previously able to use a footnote inside a caption in Pandoc:

```markdown
![Here's a caption[^1].](images/example.jpg)

[^1]: Here's a footnote.
```

But it crashes when I try this in quarto, because (I suspect) the footnote is inside the caption (and maybe something's not being escaped properly?):

```
Latexmk: If appropriate, the -f option can be used to get latexmk
  to try to force complete processing.
Reverting Windows console CPs to (in,out) = (437,65001)
Error producing PDF.
! Argument of \caption@ydblarg has an extra }.
<inserted text>
                \par
l.794   footnote.}.}
```

I'm running quarto on Windows 10.
```terminal
quarto check

[>] Checking Quarto installation......OK
      Version: 0.9.577
      Path: C:\Users\fuhrm\AppData\Local\Programs\Quarto\bin\
      CodePage: unknown

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

[>] Checking Python 3 installation....OK
      Version: 3.10.2
      Path: C:/Python310/python.exe
      Jupyter: (None)

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

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
```

### 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, self-contained, and reproducible example?
- [X] documented the quarto version you're running, by providing the output produced by `quarto check` in a terminal in your issue?
- [ ] 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-06-13T20:15:54Z
fuhrmanator
bug
Future
open
Footnote in figure caption crashes PDF render
https://github.com/quarto-dev/quarto-cli/issues/1141