mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.63k stars 131 forks source link

[BUG] Table header are rendered as td instead of th #411

Closed basile-parent closed 3 months ago

basile-parent commented 3 months ago

If you want to ask for support or request features, sponsor the project and contact me over email.

Describe the bug When creating a table, the first line should be the table header section (which is correctly rendered in the markdown mode) :

| Some | table | headers |
| ---- | ----- | ------- |
| Some | table | content |

The documentation says the table plugin enable usage of GFM markdown tables which clearly explain the column headers should be rendered in table > thead > th but they are rendered in table > tbody > td

The bug concerns the table rendering inside MDXEditor, not the markdown generated (which is correct)

Reproduction I've set a reproduction in this codesandbox but you can basically reproduce it by creating a table and looking on the devtools.

To Reproduce Steps to reproduce the behavior:

  1. Create a table on the rich text mode
  2. Open the DevTools (F12 or Ctrl + I)
  3. Inspect the generated table inside the MDXEditor

Expected behavior The table should be correctly implemented with thead and th

Screenshots image

Desktop (please complete the following information):

petyosi commented 3 months ago

That would be a good improvement indeed. Happy to accept a PR on the matter, this is the relevant node.