Skip to content

gatsby-remark-prismjs is not highlighting #35179

Answered by LekoArts
luisds95 asked this question in Help
Discussion options

You must be logged in to vote

Hi!

When you use gatsby-plugin-mdx there is no need for gatsby-transformer-remark as the latter is only for markdown files, but you're writing MDX files (the former also supports plain markdown). So configuring gatsby-transformer-remark won't change the behavior of the MDX plugin.

You'll want to remove gatsby-transformer-remark and put the gatsby-remark-prismjs configuration inside the remarkPlugins key of gatsby-plugin-mdx: https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#gatsby-remark-plugins

While people often use solutions like prism-react-renderer, the gatsby-remark-prismjs package should still work.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

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

@ameghdadian
Comment options

Answer selected by luisds95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #35176 on March 21, 2022 07:31.