question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MDX2: Table incorrectly rendering

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
ivlev-yecommented, Aug 15, 2022
1reaction
shilmancommented, Nov 7, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found