MDX2: Table incorrectly rendering
See original GitHub issueDescribe the bug
When inserting a markdown table into a .mdx
story with the previewMdx2: true
set. It causes the table to render as text instead of as a table. Disabling the previewMdx2
setting, and restarting renders the table correctly.
To Reproduce
Insert this into a .mdx
story
| Name | Value | Reference | Type |
| ---------------------------------------------------- | ------------------------- | -------------------------- | --------- |
| button-background-color-icon-dark-backdrop-default | rgba(0, 0, 0, 0) | transparent | Color |
in your main.js
set the following flag
features: {
+ previewMdx2: true
}
run npm run start-storybook
System
System:
OS: macOS 12.3.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 16.14.2 - /private/var/folders/hs/d7smfnbx6dlf7m99x1f7cn640000gs/T/xfs-2c8ef741/node
Yarn: 3.2.1 - /private/var/folders/hs/d7smfnbx6dlf7m99x1f7cn640000gs/T/xfs-2c8ef741/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Browsers:
Chrome: 103.0.5060.53
Edge: 102.0.1245.41
Firefox: 91.10.0
Safari: 15.4
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Migrating from v1 to v2 - MDX
Welcome on the MDX 2 train, it's been a journey. We know it wasn't the easiest to migrate, we're happy you're still here,...
Read more >Markdown Tables not rendering - Stack Overflow
I had a similar problem with one of these generated tables on Github Markdown and I found I needed to put a blank...
Read more >MDX and React - Docusaurus
Notice how it renders both the markup from your React component and the ... Currently, the table of contents does not contain the...
Read more >MDX 2 with Next.js and Embed Components (ESM version)
Everything is done during build/render time, so the embed code is rendered directly into the compiled html without any client-side JavaScript.
Read more >MDX - Storybook
And here's how that's rendered in Storybook: ... table: { type: { summary: 'The label contents', detail: 'Text displayed by the Badge', },...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This change should fix this https://github.com/storybookjs/mdx2-csf/pull/12
We can add an automigration that tells them:
“If you use table / x / y / z and want GFM support in MDX2, we can add it for you [y/N]”
More info: https://mdxjs.com/migrating/v2/#gfm