Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook stories from Markdown aren't working #463

Closed
shawnbot opened this issue Mar 23, 2018 · 2 comments
Closed

Storybook stories from Markdown aren't working #463

shawnbot opened this issue Mar 23, 2018 · 2 comments

Comments

@shawnbot
Copy link
Contributor

There's a lot to unpack here, but I noticed when trying to test out the popover component that the storiesFromMarkdown() helper isn't doing what it's supposed to. I started digging, and here's what I've found so far:

  1. It seems like Storybook added a raw loader rule for .md files, so ours was duplicating the "raw" conversion process and producing imported contents that look like module.exports = &quot;<content here>&quot;. I discovered this by adding a breakpoint here and inspecting the value of content.

  2. Once I got that working, I discovered some weird parsing issues with what looks like every code block. I can't tell if the issue is in html-to-react (which hasn't changed in 2 years!) or somewhere else (maybe in remark, which has undergone a major release since I added it at 8.0.0?), but it produces browser console errors that look like this:

    image

    ...which I think is referring to this code block.

Anyway, whatever the problem is, it's nullifying all of the markdown-based stories, and it needs to get fixed ASAP. ⚡️

@shawnbot
Copy link
Contributor Author

💡 Turns out, it was this commit that hosed us. When Storybook added support for Markdown, they started transforming every file that matches /\.md$/ with both the markdown and html loaders. We'll need to splice out their webpack rule for this and replace it with the "raw" loader to get our thing working again.

@shawnbot
Copy link
Contributor Author

This was fixed in #464.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants