Skip to content

bug(canvas): markdown inside table cells is not rendered — table block cells show raw **bold**/code/[link]() text #2771

Closed

Description

@vybe

Summary

Markdown inside table cells on the workspace canvas is not rendered. A table block whose cells carry **bold**, `code`, or [link](https://example.com) shows the raw markdown characters instead of formatted text. The same is true for a ```table fence embedded in a markdown block, because both paths dispatch to the same cell renderer.

Only the structured table path is affected. A GFM pipe table written directly in markdown prose goes through marked (gfm enabled) and renders inline markdown correctly — so an agent sees two "tables" on the same canvas behaving differently, and the one the MCP tool guide recommends (table = {columns, rows}) is the one that does not format.

Context

Reported from the Workspace canvas. Root cause confirmed in code:

  • src/frontend/src/components/canvas/CanvasBlock.vue delegates kind: table to ReportRenderer (REPORT_DELEGATED_KINDS in canvasUtils.js), and CanvasMarkdown.vue does the same for a ```table fence segment.
  • ReportRenderer.vue maps table → src/frontend/src/components/reports/ReportTable.vue.
  • ReportTable.vue renders every cell with plain text interpolation ({{ cell(row, col) }}); cell() stringifies the value and nothing runs it through a markdown renderer or sanitizer. Headers (<th>{{ col }}</th>) are plain text too.

Agents routinely put emphasis, inline code, and links in table cells (status columns, "see X" references, ticket links). Today those all leak as literal **/backticks/brackets.

Note the component is shared with reports (ReportRenderer is the single renderer for both, ent#537 / #1535), so a fix in ReportTable.vue changes report tables as well. That is probably desirable (same defect there), but the fix must keep the shapeOk / display-hint contract pinned by tests/unit/test_1535_report_prompt_guidance.py intact, and any rendered HTML must go through the existing DOMPurify entry points in src/frontend/src/utils/markdown.js (H-005) — no second sanitizer.

Reproduction

  1. From an agent (or via the MCP set_canvas tool) write a block:
    {"kind": "table", "title": "Repro", "payload": {"columns": ["Item", "Status"], "rows": [["**Deploy**", "`done` — see [runbook](https://example.com)"]]}}
  2. Open the Workspace → agent → Canvas tab.
  3. Observe the cell text **Deploy** and `done` — see [runbook](https://example.com) rendered literally.
  4. Write the same content as a GFM pipe table inside a markdown block — it renders bold/code/link correctly. That inconsistency is the bug.

Acceptance Criteria

  • Inline markdown (emphasis, strong, inline code, links, strikethrough) in table block cells renders as formatted text on all three canvas surfaces (Workspace rail Canvas tab, Workspace agent page, Agent Detail Canvas tab).
  • The same holds for a ```table fence inside a markdown block.
  • Links in cells get the same hardening as everywhere else (target="_blank", rel="noopener noreferrer"), and the output passes through the existing DOMPurify configuration — no raw v-html of unsanitized cell content, no second sanitizer instance.
  • Block-level markdown in a cell (headings, lists, nested tables, fenced code) is either rendered inline-only or degrades to plain text — a cell must not break the row/column layout (bug(canvas): every block layout an agent can produce renders unbroken in the workspace column — gallery test + fixes #2583 layout bar).
  • Non-string cell values (numbers, booleans, objects) keep their current rendering (JSON.stringify for objects, String() otherwise); null/undefined still render empty.
  • Column headers are handled consistently with cells (either both render inline markdown or the decision is documented in the component).
  • A unit spec in src/frontend/tests/unit/ covers: bold, inline code, a link in a cell; a raw <script>/<img onerror> payload in a cell is stripped; a numeric cell is unchanged.
  • Report tables (same component) are checked for regression — npm run test:unit green, including portalReportsRendering.spec.js and the raw-color ratchet.
  • If the decision is made that cells should stay plain text instead, the MCP set_canvas kind guide in src/mcp-server/src/tools/canvas.ts and the platform prompt say so explicitly, and this issue is closed with that rationale.

Technical Notes

Activity

  1. added
    priority-p2
    type-bug
    theme-ui-ux
    complexity-low
    status-ready
    on Sep 14, 2026
  2. dolho commented on Sep 14, 2026

    @dolho
    Contributor

    /claim

  3. added
    status-in-progress
    and removed
    status-ready
    on Sep 14, 2026
  4. github-actions commented on Sep 14, 2026

    @github-actions

    Claimed by @dolho. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/2771-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #2771
  5. added
    status-in-dev
    and removed
    status-in-progress
    on Sep 22, 2026
  6. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p2theme-ui-uxtype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions