From d1056cae6ac3335598eb51413a698cc4ea154781 Mon Sep 17 00:00:00 2001 From: sanyuan <494130947@qq.com> Date: Thu, 13 Oct 2022 13:42:32 +0800 Subject: [PATCH] fix: rehype line number plugin error --- docs/.island/config.ts | 3 ++- src/node/plugin-mdx/pluginMdxRollup.ts | 2 +- src/theme-default/styles/doc.css | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/.island/config.ts b/docs/.island/config.ts index ccbaea43..d42822bd 100644 --- a/docs/.island/config.ts +++ b/docs/.island/config.ts @@ -17,7 +17,8 @@ export default defineConfig({ }, markdown: { rehypePlugins: [], - remarkPlugins: [] + remarkPlugins: [], + lineNumbers: true }, route: { exclude: ['custom.tsx', '**/fragments/**'] diff --git a/src/node/plugin-mdx/pluginMdxRollup.ts b/src/node/plugin-mdx/pluginMdxRollup.ts index 2bf575cf..30880c40 100644 --- a/src/node/plugin-mdx/pluginMdxRollup.ts +++ b/src/node/plugin-mdx/pluginMdxRollup.ts @@ -68,7 +68,7 @@ export async function pluginMdxRollup( } ], rehypePluginPreWrapper, - ...(config.markdown?.lineNumbers ? rehypePluginLineNumbers : []), + ...(config.markdown?.lineNumbers ? [rehypePluginLineNumbers] : []), ...(config.markdown?.rehypePlugins || []) ] }) as Plugin; diff --git a/src/theme-default/styles/doc.css b/src/theme-default/styles/doc.css index c35ffc96..6ea00673 100644 --- a/src/theme-default/styles/doc.css +++ b/src/theme-default/styles/doc.css @@ -357,7 +357,6 @@ bottom: 0; left: 0; z-index: 3; - border-right: 1px solid var(--island-c-divider-dark-2); padding-top: 16px; width: 36px; text-align: center;