From 8ea934f5f873ab1610d1b966f7e9e0fb0be68c81 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 22 May 2023 19:24:27 +0100 Subject: [PATCH] feat: automatically convert h1 to h2 --- src/markdown/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/markdown/index.ts b/src/markdown/index.ts index d60284a7..ffb80306 100644 --- a/src/markdown/index.ts +++ b/src/markdown/index.ts @@ -215,6 +215,12 @@ export const renderPageContent = ( } }, }) + .use(rehypeRewrite, { + selector: "h1", + rewrite: (node: any) => { + node.tagName = "h2" + }, + }) .use(rehypePrism, { ignoreMissing: true, showLineNumbers: true,