Storybook: [5.0.0] addon-info does not render code snippet markdown given on the text parameter

Created on 6 Mar 2019  路  16Comments  路  Source: storybookjs/storybook

Describe the bug
After upgrading to 5.0.0, addon-info does not render any code snippets given via the text key on the info parameter on the addParameter() function. It successfully displays all the given text but fails and does not display the given code under the ~ ~ notation, i.e:

~
\
~js
function something(a) {
return a;
}
\~
~

To Reproduce
Steps to reproduce the behavior:

  1. Go to any story, put any string with aforementioned ~js ~ markdown notation
  2. View it on the storybook
  3. See that the supposed code snippet does not show at all.

Expected behavior
The supposed code snippet should show correctly as before

Screenshots
screen shot 2019-03-06 at 16 55 35

Code snippets
screen shot 2019-03-06 at 16 55 24

System:

  • OS: MacOS Mojave, also does not work on netlify deployment
  • Device: Macbook Pro 2017
  • Browser: Chrome
  • Framework: React
  • Addons: addon-info
  • Version: 5.0.0

Additional context
none

info bug

Most helpful comment

This needs to be merged ASAP.

All 16 comments

I am also experiencing this with the triple ` syntax.

I see this issue when using individual story parameters as well.

This needs to be merged ASAP.

I also would appreciate that fix to be released

Here are some clues I found:

This line should maybe changed to:

const Code = (props) => {
  const { language, code } = props

  return (
    <SyntaxHighlighter
      bordered
      copyable
      language={language}
    >
      {code}
    </SyntaxHighlighter>
  );
};

But then this line (and other lines will probably too) results in:

Cannot read property 'bar' of undefined

Which tells me components consuming the theme aren't up to date with the latest themes found here.

May anyone pick it up from here?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Is there any motion on this issue? Still seeing it in 5.0.10 this morning.

Yes the issue still exists..

For the sake of helping to weight this issue and keep it fresh:
Having the same issue upgrading from storybook 4 to 5.
I even tried the markdown example from the README and it is also not working.
https://github.com/storybooks/storybook/tree/master/addons/info#markdown

Hi all, still no news about this issue? It would be great to have it fixed...

Fix this plx!

This is a rather urgent problem that I feel deserves more attention, so bumping a bit.

There is a relatively easy workaround in this linked issue:

https://github.com/storybooks/storybook/pull/6016

@whengely Just be nice if it supported the syntax laid out in the documentation. The same syntax this addon supported prior.

bump

Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-alpha.29 containing PR #6016 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @debug NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

Was this page helpful?
0 / 5 - 0 ratings