From bf34a225c082de05ad77edf54a9329f4fbdabe56 Mon Sep 17 00:00:00 2001 From: Krishna Ayyalasomayajula Date: Tue, 2 Jun 2026 11:59:47 -0500 Subject: [PATCH] Revert "mdx: add remark-frontmatter to pipeline, fix rehype-pretty-code line numbers visitor" This reverts commit 9867a74bdd273f2282f290068b772c0b39c2306e. --- next.config.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/next.config.ts b/next.config.ts index 06cd03e..0bd1498 100644 --- a/next.config.ts +++ b/next.config.ts @@ -9,7 +9,7 @@ const nextConfig: NextConfig = { const withMDX = createMDX({ options: { - remarkPlugins: ['remark-frontmatter', 'remark-smartypants', 'remark-math', 'remark-gfm'], + remarkPlugins: ['remark-smartypants', 'remark-math', 'remark-gfm'], rehypePlugins: [ 'rehype-slug', ['rehype-external-links', { target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer'] }], @@ -17,18 +17,9 @@ const withMDX = createMDX({ ['rehype-pretty-code', { theme: { light: 'github-light', dark: 'github-dark-dimmed' }, keepBackground: false, + lineNumbers: true, grid: true, }], - (tree) => { - const { visit } = require('unist-util-visit') - visit(tree, 'element', (node: any) => { - if (node.tagName === 'pre' && node.children?.length === 1 && node.children[0].type === 'element' && node.children[0].tagName === 'code') { - const code = node.children[0] - code.properties = code.properties || {} - code.properties['data-line-numbers'] = '' - } - }) - }, 'rehype-katex', ], },