[addon-docs] Newlines not rendered in markdown code blocks in prop comments
See original GitHub issueDescribe the bug When adding code blocks to a docblock in markdown format, they appear in Storybook as a single line instead of properly formatted.
To Reproduce Add the following comment to a propType declaration:
/**
* ```
* classNames={{
* appear: 'my-appear',
* appearActive: 'my-active-appear',
* appearDone: 'my-done-appear',
* enter: 'my-enter',
* enterActive: 'my-active-enter',
* enterDone: 'my-done-enter',
* exit: 'my-exit',
* exitActive: 'my-active-exit',
* exitDone: 'my-done-exit',
* }}
* ```
*/
Expected behavior It should appear in Storybook as follows:
classNames={{
appear: 'my-appear',
appearActive: 'my-active-appear',
appearDone: 'my-done-appear',
enter: 'my-enter',
enterActive: 'my-active-enter',
enterDone: 'my-done-enter',
exit: 'my-exit',
exitActive: 'my-active-exit',
exitDone: 'my-done-exit',
}}
Actual Behavior It appears as:
classNames={{ appear: 'my-appear', appearActive: 'my-active-appear', appearDone: 'my-done-appear', enter: 'my-enter', enterActive: 'my-active-enter', enterDone: 'my-done-enter', exit: 'my-exit', exitActive: 'my-active-exit', exitDone: 'my-done-exit', }}
System:
Environment Info:
System:
OS: macOS 10.15.5
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
npm: 6.14.5 - ~/Desktop/react-skeleton-generator/waltz/node_modules/.bin/npm
Browsers:
Chrome: 83.0.4103.116
Firefox: 77.0.1
Safari: 13.1.1
npmPackages:
@storybook/addon-a11y: ^5.3.19 => 5.3.19
@storybook/addon-actions: ^5.3.19 => 5.3.19
@storybook/addon-docs: ^5.3.19 => 5.3.19
@storybook/addon-knobs: ^5.3.19 => 5.3.19
@storybook/addon-links: ^5.3.19 => 5.3.19
@storybook/addon-viewport: ^5.3.19 => 5.3.19
@storybook/addons: ^5.3.19 => 5.3.19
@storybook/react: ^5.3.19 => 5.3.19
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How can I insert a blank un-formatted line in code block in ...
I just solved it, thanks to a comment (which has since been deleted). To force separate code blocks, place a <blank> tag between...
Read more >@storybook/addon-viewport | Yarn - Package Manager
Storybook Viewport Addon allows your stories to be displayed in different sizes and layouts in Storybook. This helps build responsive components inside of ......
Read more >DocsPage code preview indentation is wrong. #8078 - Issuehunt
Go to DocsPage for that component; Click "Code" button to bring up code preview; See wrong indentation for code preview. Expected behavior The...
Read more >Docs Addon | Storybook: Frontend workshop for UI development
Document component usage and properties in Markdown. ... text descriptions, docgen comments, props tables, and code examples into clean, readable pages.
Read more >CHANGELOG · master · Papa Dragon / core · GitLab
Do not show summary if it is equal to body. 829. - Update code tag styling so bbcode [code] blocks and wiki markdown...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shilman Superb! I am more than happy to do an attempt 😄
Jeepers creepers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.31 containing PR #12882 that references this issue. Upgrade today to the
@next
NPM tag to try it out!