Skip to content

Commit

Permalink
Fix MDX v1 remark/rehype plugin loading after migration
Browse files Browse the repository at this point in the history
During the migration to MDX 1.0.0 (1) in GH-137 the now deprecated (2)
`mdPlugins` and `hastPlugins` options were not replaced with their
(new named) respective equivalents `remarkPlugins` and `rehypePlugins`.
Even if the documentation states that the options will be removed in v2
and are still supported (only showing a warning in the console when
still used), the defined plugins were not loaded anymore causing e.g.
no more automatic generation of `id` attributes for headers in MDX
content.

Therefore, to finish 100% of the migration, both options have been
renamed.

References:
  (1) https://mdxjs.com/blog/v1
  (2) https://mdxjs.com/blog/v1#deprecations

GH-144
  • Loading branch information
arcticicestudio committed May 21, 2019
1 parent c569455 commit 7115056
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gatsby/plugins/mdx.js
Expand Up @@ -34,6 +34,6 @@ module.exports = {
},
footnotes: true,
gatsbyRemarkPlugins: [],
hastPlugins: [rehypeSlug],
mdPlugins: [remarkBreaks, [remarkGitHub, remarkGitHubOptions]]
rehypePlugins: [rehypeSlug],
remarkPlugins: [remarkBreaks, [remarkGitHub, remarkGitHubOptions]]
};

0 comments on commit 7115056

Please sign in to comment.