quarto-dev / quarto-dev/quarto
Visual Editor strips cross-reference ID from inline table caption
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
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 https://github.com/quarto-dev/quarto-cli/discussions/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
- IDE: RStudio 2026.04.0 Build 526 (per discussion https://github.com/quarto-dev/quarto-cli/discussions/14514); also reproducible in VSCode / Positron Visual Editor.
- OS: Windows 11 (reporter); reproducible on macOS.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the round-trip with the provided issue.qmd in the Visual Editor, comparing the inline caption form with the preserved div form. Trace the editor's source serialization for table captions and verify that switching views preserves {#tbl-one} and resolves @tbl-one after saving.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100