How do I add code blocks to my MDX files? #24682
-
I was using Storybook 7 (beta) and had some code blocks using standard markdown:
I've updated all my dependencies to the latest Storybook (7.5.2) but my codeblocks all broke. I was using the
So I'm wondering how people are adding in codeblocks or have I just hit a bug? Here's my current config file:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I've noticed that
The broken one just has:
|
Beta Was this translation helpful? Give feedback.
-
@IPWright83, thanks for taking the time to reach out to us with your question. We appreciate it 🙏 ! And to give you some context, documentation and, in this case, syntax highlighting was something that got some improvements with the major release (e.g., 7.0) and continued to get more updates in follow-up releases (e.g., 7.1, etc). If there's no language specified using triple backticks Storybook treats it as text by default. If you specify one of the supported languages (i.e., Javascript, Markdown, CSS, HTML, Typescript, GraphQL) it will recognize it and style it accordingly. I've created a small reproduction here if you're interested and got it deployed here Let us know if this was able to unblock you and get your documentation showcased as it should. If not can you provide us a reproduction so that it can be looked at? Looking forward to hearing from you. Have a fantastic day. Stay safe |
Beta Was this translation helpful? Give feedback.
@IPWright83, thanks for taking the time to reach out to us with your question. We appreciate it 🙏 ! And to give you some context, documentation and, in this case, syntax highlighting was something that got some improvements with the major release (e.g., 7.0) and continued to get more updates in follow-up releases (e.g., 7.1, etc). If there's no language specified using triple backticks Storybook treats it as text by default. If you specify one of the supported languages (i.e., Javascript, Markdown, CSS, HTML, Typescript, GraphQL) it will recognize it and style it accordingly. I've created a small reproduction here if you're interested and got it deployed here
Let us know if this was able …