fix: render markdown tables correctly in chat responses#12430
Open
ajayjha1 wants to merge 1 commit into
Open
Conversation
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix markdown tables rendering as unformatted text in chat responses.
Two issues were causing this:
remarkTables.tsx, header cells were built withtype: "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 totype: "tableCell"to match how body cells are built.StyledMarkdownPreview/index.tsx, theStyledMarkdowncomponent had notable,th, ortdCSS rules. Table styles inmarkdown.cssare scoped to.wmde-markdownwhich 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
@continue-reviewChecklist
Tests
No new tests added. The existing
remarkTablesplugin 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.
element thto MDASTtableCellin the remark-to-rehype pipeline so headers render properly.table,th, andtdin 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