Storybook: addon/notes: syntaxhighlighter treat children as string may have errors

Created on 17 Jul 2019  路  4Comments  路  Source: storybookjs/storybook

Describe the bug
I encountered an error while writing markdown in notes, the console suggesting that children.trim is not a function.

The strange thing is that only when I write the code block such as ```jsx will report an error, there is no problem writing the general markdown code.

To Reproduce
write code block in notes suchs as:
image

Screenshots
image

System:

  • OS: Windows10
  • Browser: chrome
  • Framework: Vue
  • Addons: notes
  • Version: 5.1.9

Additional context
the children prop may be an array, treat children as string may have errors:
https://github.com/storybookjs/storybook/blob/538924f3e2995aafeb3935b2e985f5357d4d0df5/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx#L156

notes inactive question / support

Most helpful comment

Please take a look at Storybook Docs, which is intended to replace addon-info and addon-notes, doesn't have this problem, and is being more actively maintained: https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

All 4 comments

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!

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Is there any news about this issue? Simple block code with triple ` works fine, but if you specify language such as js, html or something else it throws this error.

Please take a look at Storybook Docs, which is intended to replace addon-info and addon-notes, doesn't have this problem, and is being more actively maintained: https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

Was this page helpful?
0 / 5 - 0 ratings