Skip to content

difficulty with code blocks in v2 #1891

Answered by ChristianMurphy
godmar asked this question in Q&A
Discussion options

You must be logged in to vote

Also, FWIW, in next.js at least I couldn't get the first approach, even though I added the plugin to rehypePlugins in next.config.js as described here.

@next/mdx is maintained at https://github.com/vercel/next.js, the next team may be able to provide more context on why it isn't working https://github.com/vercel/next.js/discussions

That said you don't need to use @next/mdx, @mdx-js/loader can be used directly with next without a wrapper https://mdxjs.com/docs/getting-started/#nextjs
and supports rehype-highlight, for example: https://codesandbox.io/s/mdx-loader-with-rehype-highlight-nu41j

example next.config.mjs
// ⚠️ Important! Please make sure the dependencies are up to date.

import r…

Replies: 6 comments 12 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@godmar
Comment options

@godmar
Comment options

@wooorm
Comment options

Comment options

You must be logged in to vote
2 replies
@wooorm
Comment options

@godmar
Comment options

Comment options

You must be logged in to vote
6 replies
@ChristianMurphy
Comment options

@godmar
Comment options

@ChristianMurphy
Comment options

@godmar
Comment options

@godmar
Comment options

Answer selected by ChristianMurphy
Comment options

You must be logged in to vote
1 reply
@wooorm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants