镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix: render Markdown tables in the page review card - #78

Open
charan-rathore wants to merge 1 commit into
CopilotKit:mainfrom
charan-rathore:fix-review-card-markdown-tables-66
Open

charan-rathore wants to merge 1 commit into
CopilotKit:mainfrom
charan-rathore:fix-review-card-markdown-tables-66

Conversation

@charan-rathore

Copy link
Copy Markdown

Fixes #66

What changed

The "Ready for your review" card renders the draft with react-markdown without GFM support, so a Markdown table showed as raw | Category | ... | text. The card now uses remark-gfm, so tables render as tables, matching what the page editor shows after Approve & save.

remark-gfm is already installed in node_modules through the CopilotKit dependency tree (4.0.1). I added it as a direct dependency (^4.0.1) in package.json and the matching root entry in package-lock.json; no other lockfile entries changed.

Tests

  • Added a test in tests/page-review.test.tsx that 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 --noEmit is 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review card shows Markdown tables as raw pipe text

1 participant