Importing and rendering MD in *.stories.mdx doesn't render code blocks correctly
See original GitHub issueTo Reproduce
I have a Markdown file being imported into a .stories.mdx
file and, while it renders, I’m noticing differences between the imported version and writing it directly in the mdx file. See code snippets and screenshots below.
Expected behavior
I would expect the code fence to look the same in the imported file as is does if I wrote it in the *.stories.mdx
file.
Screenshots If applicable, add screenshots to help explain your problem.
Code snippets If applicable, add code samples to help explain your problem.
// Readme.md
An `inline` codeblock
` ``
A fenced codeblock (without extra spaces)
` ``
// Overview.stories.mdx
import { Meta, Description } from '@storybook/addon-docs/blocks';
import Readme from '../Readme.md';
<Meta title="Overview" />
<Description>{Readme}</Description>
System
Environment Info:
System: OS: macOS 11.1 CPU: (8) x64 Intel® Core™ i7-7820HQ CPU @ 2.90GHz Binaries: Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.8 - ~/.nvm/versions/node/v12.19.0/bin/npm Browsers: Chrome: 87.0.4280.88 Firefox: 84.0 Safari: 14.0.2
Additional context It seemed like some people were having similar issues over in #7644
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top GitHub Comments
@shilman I opened a PR fixing this 😄 https://github.com/storybookjs/storybook/pull/14495
@shilman I’d like to give this one a shot! 😄