Fix rehype accessible table plugins - #2493
Conversation
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
krzysdz
left a comment
There was a problem hiding this comment.
Somehow this PR breaks multiple things (other plugins?).
The tables in "Moving to Express 4" don't have scope on <th> elements, because :<tbody> is missing
If I'm reading the code (and old comments) correctly these should have scope="row" (according to code, not really how it should be). On a closer look scope seems to be missing everywhere (e.g. in the routing guide).
As a side note, I've noticed that the HTML <table>s have <p>s inside cells if the text is multiline. In the big tables ("behind proxies") this is may not be obvious, but in "Migrating to Express 4" only some rows have <p> elements and this causes them to have much bigger padding than other rows - rewriting them to Markdown (#2485) lets us avoid this and fixes the table structure (missing <thead>).
…es and wrap tables without affecting traversal
|
4e49d37 Uses separate passes to keep AST traversal predictable while supporting both HAST and MDX JSX tables. Build time remains unchanged. |
This will be handled by expressjs#2493
|
This wrapper from a table in 5.1 release post can also be removed. It doesn't do anything, because the |
Co-authored-by: krzysdz <12915102+krzysdz@users.noreply.github.com>
|
removed html wrapper in 07c9eca
|
|
|



This plugin was failing because it only handled standard Hypertext Abstract Syntax Tree format table nodes and missed tables authored as raw HTML inside MDX/Markdown (mdxJsxFlowElement, mdxJsxTextElement).
The fix registers the plugin in both Markdown and MDX pipelines and updates the transform to support both raw HTML and standard table nodes, ensuring consistent scrollable table behavior.
This fixes the missing wrapper for raw HTML tables: https://deploy-preview-2493--expressjscom-preview.netlify.app/en/5x/guide/behind-proxies/
and markdown-generated tables: https://deploy-preview-2493--expressjscom-preview.netlify.app/en/resources/middleware/
closes #2484