Skip to content

fix(mdxish): render and parse tables without <tr>#1411

Open
maximilianfalco wants to merge 4 commits intonextfrom
falco/rm-15641-thead-requires-tr-wrapper-in-table-components
Open

fix(mdxish): render and parse tables without <tr>#1411
maximilianfalco wants to merge 4 commits intonextfrom
falco/rm-15641-thead-requires-tr-wrapper-in-table-components

Conversation

@maximilianfalco
Copy link
Copy Markdown
Contributor

@maximilianfalco maximilianfalco commented Mar 30, 2026

🎫 Resolve RM-15641

🎯 What does this PR do?

Fixes <Table> components where <thead> or <tbody> cells aren't wrapped in an explicit <tr>. This is valid HTML that browsers render fine, but MDXish was producing empty/broken tables because the conversion logic only looked for cells inside <tr> elements.

Two fixes in two files:

  • mdxish-tables.ts — The phrasing-only renderer now checks whether a <thead>/<tbody> section has <tr> children. If not, it collects cells directly from the section and treats them as a single implicit row.
  • mdxish-jsx-to-mdast.ts — The transformTable MDAST converter normalizes bare cells into an implicit <tr> wrapper before processing, so the existing row-based logic works unchanged.

🧪 QA tips

Paste this into a doc using the MDXish editor and verify it renders a table with headers "Hi" / "World" and body cells "Hello" / "Globe":

<Table>
  <thead>
    <td>Hi</td>
    <td>World</td>
  </thead>
  <tbody>
    <td>Hello</td>
    <td>Globe</td>
  </tbody>
</Table>
  • Table renders with both header and body rows
  • Switching to native <table> still works as before
  • Tables with explicit <tr> wrappers are unaffected
  • Tables with flow content (code blocks, lists) in bare cells still render

📸 Screenshot or Loom

Screen.Recording.2026-03-30.at.17.08.11.mov

@maximilianfalco maximilianfalco marked this pull request as ready for review March 30, 2026 08:47
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.

1 participant