Bug description
Switching a .qmd from source to the Visual Editor (and back) strips the cross-reference ID from a table caption written in the inline form : Caption {#tbl-one}.
After the round-trip the caption becomes : Caption and @tbl-one no longer resolves.
The equivalent div form ::: {#tbl-two} ... ::: is preserved, so the bug is specific to the inline caption attribute syntax.
Originally reported in quarto-dev/quarto-cli#14514.
Steps to reproduce
-
Create issue.qmd:
---
title: About
format: html
---
@tbl-one and @tbl-two
| A | B | C |
|---|---|---|
| 1 | 2 | 3 |
: Caption {#tbl-one}
::: {#tbl-two}
| A | B | C |
|---|---|---|
| 1 | 2 | 3 |
Caption
:::
-
Open in the Visual Editor, make any edit (or just toggle and save).
-
Switch back to source.
Actual behavior
The {#tbl-one} attribute is removed from the caption:
| A | B | C |
|-----|-----|-----|
| 1 | 2 | 3 |
: Caption
@tbl-one renders as ?@tbl-one and the cross-reference is broken.
The {#tbl-two} div form survives the round-trip unchanged.
Expected behavior
The Visual Editor should preserve {#tbl-one} on the table caption across round-trips, matching its behaviour for div-wrapped tables.
Your environment
Bug description
Switching a
.qmdfrom source to the Visual Editor (and back) strips the cross-reference ID from a table caption written in the inline form: Caption {#tbl-one}.After the round-trip the caption becomes
: Captionand@tbl-oneno longer resolves.The equivalent div form
::: {#tbl-two} ... :::is preserved, so the bug is specific to the inline caption attribute syntax.Originally reported in quarto-dev/quarto-cli#14514.
Steps to reproduce
Create
issue.qmd:Open in the Visual Editor, make any edit (or just toggle and save).
Switch back to source.
Actual behavior
The
{#tbl-one}attribute is removed from the caption:@tbl-onerenders as?@tbl-oneand the cross-reference is broken.The
{#tbl-two}div form survives the round-trip unchanged.Expected behavior
The Visual Editor should preserve
{#tbl-one}on the table caption across round-trips, matching its behaviour for div-wrapped tables.Your environment