### Bug description

The following qmd file:

```
---
format: html
---

![An Elephant](elephant.png){#fig-elephant}

This is illustrated well by @fig-elephant.
```

after rendering results in a notebook with a single markdown cell with this content:

```
# 

![Figure 1: An Elephant](attachment:elephant.png)

This is illustrated well by [Figure 1](#fig-elephant).
```

Here, the figure caption is missing.

Screenshot:

![image](https://user-images.githubusercontent.com/1122351/220110592-af16bd23-1915-4afc-ab23-829e01371af9.png)


While this version, using a figure div:

```
---
format: html
---

::: {#fig-elephant}

![](elephant.png){#fig-elephant}

An Elephant
:::

This is illustrated well by @fig-elephant.
```

renders to a notebook with a single markdown cell with this content:

```
# 

![(a)](attachment:elephant.png)

Figure 1: An Elephant

This is illustrated well by [Figure 1](#fig-elephant).
```

Screenshot:

![image](https://user-images.githubusercontent.com/1122351/220110374-633d4bd6-ea97-4368-a386-2c75c21bb0c0.png)


The figure caption is now present.

Desired outcome: figure caption present in both cases. 

I considered using a figure div for my use case, but when combined with `{#fig-elephant fig-width=400 fig-alt="Drawing of an elephant."}` this crashes in during conversion to PDF with a `not in outer par mode` error, probably related to #4142.

Note that also, in both cases, the anchor to the figure does not work (there is no target for the link), but this may be related to #4178.

I am using VSCode to write qmd files, but render them on the command line (Mac OS 11.7), using quarto installed directly from the GitHub repo, commit id #82eae91a0 (which is why quarto --version gives 99.9.9).

### 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.
cscheid
2023-02-20T12:53:18Z
lexnederbragt
needs-repro
closed
Figure caption missing in Jupyter notebook
https://github.com/quarto-dev/quarto-cli/issues/4435