Skip to content

fix: render markdown tables correctly in chat responses#12430

Open
ajayjha1 wants to merge 1 commit into
continuedev:mainfrom
ajayjha1:fix/markdown-table-rendering
Open

fix: render markdown tables correctly in chat responses#12430
ajayjha1 wants to merge 1 commit into
continuedev:mainfrom
ajayjha1:fix/markdown-table-rendering

Conversation

@ajayjha1
Copy link
Copy Markdown

@ajayjha1 ajayjha1 commented May 17, 2026

Description

Fix markdown tables rendering as unformatted text in chat responses.

Two issues were causing this:

  1. In remarkTables.tsx, header cells were built with type: "element", tagName: "th" — a raw hast node injected into an MDAST tree. The remark-to-rehype pipeline doesn't handle this correctly, causing header cells to fall through as plain text. Changed to type: "tableCell" to match how body cells are built.
  2. In StyledMarkdownPreview/index.tsx, the StyledMarkdown component had no table, th, or td CSS rules. Table styles in markdown.css are scoped to .wmde-markdown which is never applied here, so tables had no borders or styling. Added table styles using VS Code CSS variables for theme compatibility.

Fixes #12167

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created
Screenshot 2026-05-17 at 2 50 02 PM

Tests

No new tests added. The existing remarkTables plugin logic is covered by the change to use the correct MDAST node type (tableCell), which is consistent with how body rows were already being built. Manual testing confirmed tables now render with proper borders, bold headers, and alternating row colors in the VS Code extension chat.


Summary by cubic

Fixes markdown tables rendering as plain text in chat responses. Header cells now parse correctly, and tables use theme-aware styles with borders and alternating rows.

  • Bug Fixes
    • Changed header cells from a raw hast element th to MDAST tableCell in the remark-to-rehype pipeline so headers render properly.
    • Added CSS for table, th, and td in StyledMarkdown using VS Code variables for borders, bold headers, and zebra striping.

Written for commit 5566065. Summary will update on new commits. Review in cubic

@ajayjha1 ajayjha1 requested a review from a team as a code owner May 17, 2026 09:28
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Model response with unformatted markdown table

1 participant