Skip to content

fix: add rehype-raw plugin to render raw HTML tables in markdown content#75

Open
fallleave001 wants to merge 2 commits into
agegr:mainfrom
fallleave001:fix/html-table-rendering
Open

fix: add rehype-raw plugin to render raw HTML tables in markdown content#75
fallleave001 wants to merge 2 commits into
agegr:mainfrom
fallleave001:fix/html-table-rendering

Conversation

@fallleave001

Copy link
Copy Markdown

Problem

Markdown content containing raw HTML <table> elements is not rendered
as tables in two places:

  1. Chat messages (MarkdownBody.tsx): HTML tags are silently stripped
    by react-markdown because rehype-raw is not included.
  2. File preview (FileViewer.tsx): Same issue in the markdown file
    preview (Preview mode).

Fix

Add rehype-raw to the rehypePlugins array in both components:

  • components/MarkdownBody.tsx — used for chat message rendering
  • components/FileViewer.tsx — used for markdown file preview

Both already had remarkGfm / rehype-katex but were missing
rehype-raw for raw HTML passthrough.

Testing

Confirmed that HTML <table> in .md files renders correctly in both
chat messages and file preview mode.

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.

2 participants