### Bug description

Table captions and references do not render in the HTML document when using Jupyter Lab. Also, the code will still appear even if using `echo: false`.

I'm using MacOS Monterrey 12.4 (M1)

````md
```header
---
title: 'Table Issue'
author: 'Phil Patton'
number-sections: false
highlight-style: pygments

format:
  html:
    code-fold: true
    self-contained: true
jupyter: python3
reference-location: margin
citation-location: margin
---
```

```py
#| label: tbl-planets
#| tbl-cap: Planets
#| echo: false

from IPython.display import Markdown
from tabulate import tabulate
table = [["Sun",696000,1989100000],
         ["Earth",6371,5973.6],
         ["Moon",1737,73.5],
         ["Mars",3390,641.85]]
Markdown(tabulate(
  table, 
  headers=["Planet","R (km)", "mass (x 10^29 kg)"]
))
```
````

<img width="858" alt="Screen Shot 2022-08-02 at 8 20 09 AM" src="https://user-images.githubusercontent.com/15240814/182445908-8f5c1bca-270e-4ea7-a8da-ce1f444cac94.png">


### `quarto check` Output

```bash
[✓] Checking Python 3 installation....OK
      Version: 3.10.5 (Conda)
      Path: /Users/philtpatton/miniforge3/envs/hws/bin/python
      Jupyter: 4.10.0
      Kernels: python3

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

### `quarto tools check` Output

```bash
(/) Inspecting toolsDownload https://deno.land/x/cache@0.2.12/directories.ts
(|) Inspecting toolsDownload https://deno.land/x/cache@0.2.12/deps.ts
[✓] Inspecting tools

Tool         Status            Installed     Latest  
chromium     Not installed     ---           869685  
tinytex      Not installed     ---           v2022.08
```

### 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.
- [ ] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
jjallaire
2022-08-02T18:23:21Z
philpatton
bug
v1.1
closed
Issue with table captions, references in Jupyter Lab
https://github.com/quarto-dev/quarto-cli/issues/1646