fix: render Markdown tables in the page review card - #78
Open
charan-rathore wants to merge 1 commit into
Open
charan-rathore wants to merge 1 commit into
charan-rathore wants to merge 1 commit into
Conversation
The review card rendered the draft with react-markdown without GFM, so tables showed as raw pipe text. Add remark-gfm, which is already installed through the CopilotKit dependency tree, as a direct dependency and use it for the card.
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.
Fixes #66
What changed
The "Ready for your review" card renders the draft with
react-markdownwithout GFM support, so a Markdown table showed as raw| Category | ... |text. The card now usesremark-gfm, so tables render as tables, matching what the page editor shows after Approve & save.remark-gfmis already installed innode_modulesthrough the CopilotKit dependency tree (4.0.1). I added it as a direct dependency (^4.0.1) inpackage.jsonand the matching root entry inpackage-lock.json; no other lockfile entries changed.Tests
tests/page-review.test.tsxthat renders the card with a table draft and checks for<table>,<th>and<td>output and no raw pipe text. It fails without the change and passes with it.npx vitest run: 35 files, 165 tests pass (current main c2569bb).npx tsc --noEmitis clean, eslint and prettier --check are clean on the changed files.Not run
I did not run the production build or look at the card in a browser. Table styling inside the card uses the existing defaults and is not visually checked. Other places that render Markdown with
react-markdown(chat transcript, result pane) are unchanged.