Syntax highlighting for diff code blocks in .mdx not working after 6.1.x+
See original GitHub issueDescribe the bug In 6.0.x, the syntax highlighting for diffs was supported in mdx out-of-the-box. After upgrading to 6.1.x or later, this is no longer the case.
To Reproduce Steps to reproduce the behavior:
- Clone the repro repo
- Switch to the branch corresponding to the Storybook version to test (
git checkout 6.1.xor6.0.x) - Run
yarn install && yarn storybook - View the “Introduction” story in the launched Storybook dev server
Expected behavior Syntax highlighting on diff code blocks should work or be supported
Screenshots
Before (6.0.x) 😎

After (6.1.x+) 😢

Additional context Not sure if there’s a work-around for this currently that I might be missing, but I can dig around the docs and see
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Syntax highlighting - MDX
This guide explores how to apply syntax highlighting to code blocks. MDX supports standard markdown syntax (CommonMark). It does not apply ...
Read more >Using Prismjs for syntax highlighted code blocks is breaking ...
I'm running into an issue where the rendered code blocks (inside a <pre> element are too wide on my mobile layout. For now...
Read more >NextJS MDX Blog with Syntax Highlighting and TypeScript
In this video we will build out the functionality such that we can create blog posts using MDX so we can use components...
Read more >rehype-prism-plus - npm
rehype plugin to highlight code blocks in HTML with Prism (via refractor) with additional line highlighting and line numbers functionalities.
Read more >remark-prism | Yarn - Package Manager
Syntax highlighter for markdown code blocks using Prism - with support for certain ... This allows syntax highlighting without running any client-side code ......
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 Free
Top 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

We removed a bunch of syntax highlighters as part of a performance push in 6.1. The bundle size and build times were both reduced substantially. We might consider adding this one back, or figure out how to make it opt-in.
Closing this now as the pr with documentation updates to address this issue was merged and should be published soon.
Let me know if the issue surfaces back and I’ll gladly re-open and we can follow up on it until we have a solution.
Stay safe all