aboutsummaryrefslogtreecommitdiffstats
path: root/next.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'next.config.js')
-rw-r--r--next.config.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/next.config.js b/next.config.js
index 8227603..6e404a5 100644
--- a/next.config.js
+++ b/next.config.js
@@ -3,6 +3,7 @@ import { fileURLToPath } from 'node:url';
import bundleAnalyzer from '@next/bundle-analyzer';
import nextMDX from '@next/mdx';
import rehypeSlug from 'rehype-slug';
+import { visit } from 'unist-util-visit';
const currentDir = dirname(fileURLToPath(import.meta.url));
@@ -161,11 +162,19 @@ const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
+const overrideHTMLTags = () => (tree) => {
+ visit(tree, 'mdxJsxTextElement', (node) => {
+ if (node.data) {
+ delete node.data._mdxExplicitJsx;
+ }
+ });
+};
+
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
- rehypePlugins: [rehypeSlug],
+ rehypePlugins: [rehypeSlug, overrideHTMLTags],
},
});