Skip to content

Python table with jupyter is showing label in caption when not a cross referenced table Β #8428

@cderv

Description

@cderv
---
title: "Test"
format: html
keep-md: true
---

```{python}
#| label: test
#| tbl-cap: 
#|  - Test caption
import pandas as pd
from IPython.display import display, Markdown
penguins = pd.read_csv("https://pos.it/palmer-penguins-github-csv")
markdown_result = penguins.groupby("species").size().to_markdown(index=False, tablefmt="pipe", stralign="right")
display(Markdown(markdown_result))
```

This output to
image

See {#cell-test} appearing in table caption

Intermediate md is

---
title: "Test"
format: html
keep-md: true
---


::: {#cell-test .cell tbl-cap='["Test caption"]' execution_count=1}
``` {.python .cell-code}
import pandas as pd
from IPython.display import display, Markdown
penguins = pd.read_csv("https://pos.it/palmer-penguins-github-csv")
markdown_result = penguins.groupby("species").size().to_markdown(index=False, tablefmt="pipe", stralign="right")
display(Markdown(markdown_result))
```

::: {#test .cell-output .cell-output-display .cell-output-markdown}
|   0 |
|----:|
| 152 |
|  68 |
| 124 |
:::
:::

This should not be there

Metadata

Metadata

Assignees

Labels

backportbugSomething isn't workingcrossreftablesIssues with Tables including the gt integration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions