Skip to content

Losing table labels in cross references in quarto - markdown tables #13204

Open

Description

@SWilsonWoll

Type: Bug

This code, entered ini source mode renders fine.

Going to include some code here. See @tbl-params for the parameters used.

Variable Value
Reference Channel 2
Ref. Channel cal. 4

: Parameters used. {#tbl-params}

However, when I switch to visual mode {#tbl-params} is lost, never to return.

Version: Positron 2026.04.1+10 (5dfc924, 2026-04-14T01:11:42.088Z)
Code - OSS version: VS Code 1.109.2
OS version: Darwin arm64 25.4.0
Modes:

System Info
Item Value
CPUs Apple M4 Pro (12 x 2400)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 48.00GB (3.12GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (16)
Extension Author (truncated) Version
ruff cha 2026.38.0
vscode-pull-request-github Git 0.128.0
vscode-zotero jin 1.4.2
positron-r-package-manager kv9 0.2.5
pyrefly met 0.62.0
debugpy ms- 2025.18.0
jupyter ms- 2025.9.1
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
air-vscode Pos 0.24.0
assistant pos 0.3.3
publisher pos 2.0.0
shiny Pos 1.4.1
quarto qua 1.131.0

Activity

  1. softwarenerd commented on Apr 27, 2026

    @softwarenerd
    Contributor

    Starting with:

    ---
    title: "Table cross-reference repro"
    format: html
    ---
    
    Going to include some code here. See @tbl-params for the parameters used.
    
    | Variable          | Value           |
    |-------------------|-----------------|
    | Reference Channel | 2               |
    | Ref. Channel cal. | 4               |
    
    : Parameters used. {#tbl-params}

    I used Edit in Visual Mode to switch to visual mode. I then saved the document.
    Next, I used Edit in Source Mode to switch to source mode. After doing this, the document looked like:

    ---
    title: "Table cross-reference repro"
    format: html
    ---
    
    Going to include some code here. See @tbl-params for the parameters used.
    
    | Variable          | Value |
    |-------------------|-------|
    | Reference Channel | 2     |
    | Ref. Channel cal. | 4     |
    
    : Parameters used.

    And {#tbl-params} was lost.

  2. juliasilge commented on Apr 28, 2026

    @juliasilge
    Member

    We chatted about this in quarto-dev/quarto#944 (comment), and it sounds like @cscheid thought this was an expected change with the new version of pandoc.

    Can I ask you to look at this, @cscheid, to let me know if we think we should protect against losing these kinds of IDs when round-tripping between visual and source mode?

  3. added
    area: quarto
    on Apr 28, 2026
  4. added theissue type on Apr 28, 2026
  5. removed theissue type on Apr 28, 2026
  6. cscheid commented on Apr 28, 2026

    @cscheid

    We chatted about this in quarto-dev/quarto#944 (comment), and it sounds like @cscheid thought this was an expected change with the new version of pandoc.

    Sorry, I should have been clearer in that message! I should have said "it's not surprising that this behavior changed, because Pandoc changed how they handle these attributes". I didn't mean "this should no longer work"!

    The fix here will almost certainly involve a change in the Lua filter we use for the visual editor writer.

  7. self-assigned this
    on Apr 28, 2026
  8. added theissue type on Apr 29, 2026
  9. added this to the 2026 Backlog milestone on Apr 29, 2026
  10. mcanouil commented on May 14, 2026

    @mcanouil

    Workaround/recommendation to avoid the issue is to use the Div syntax:

    ::: {#tbl-one}
    | A   | B   | C   |
    |-----|-----|-----|
    | 1   | 2   | 3   |
    
    Caption
    :::
  11. SWilsonWoll commented on May 20, 2026

    @SWilsonWoll
    Author

    I can confirm that the Div syntax works nicely - although with my hamfisted modification to the actual quarto document I ended up with :::::: at the end of (quite long) document. Presumably an autocomplete that was not appropriate in this case. Very easy to fix though!

  12. volumen25 commented on Aug 21, 2026

    @volumen25

    I have a similar problem with LaTeX when switching to the Visual Editor

    37.5\%	
    

    becomes

    37.5%
    

    Likewise, a table identifier:

    : Examples of process variables {#tbl-process-variables}
    

    becomes

    : Examples of process variables
    

    more details here

    The workaround

    ::: {#tbl-one}
    | A   | B   | C   |
    |-----|-----|-----|
    | 1   | 2   | 3   |
    
    Caption
    :::
    

    works but LaTeX escape character is still lost.

    pandoc --version
    pandoc 3.10.2
    Features: +server +lua
    Scripting engine: Lua 5.4
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: quarto

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions