diff --git a/plugins/markdown/plugin-prismjs/src/node/prepareConfigFile.ts b/plugins/markdown/plugin-prismjs/src/node/prepareConfigFile.ts index a431fdf51..fe955f487 100644 --- a/plugins/markdown/plugin-prismjs/src/node/prepareConfigFile.ts +++ b/plugins/markdown/plugin-prismjs/src/node/prepareConfigFile.ts @@ -11,7 +11,8 @@ export const prepareConfigFile = ( theme, themes, lineNumbers = true, - collapsedLines, + highlightLines = true, + collapsedLines = 'disable', notationDiff, notationErrorLevel, notationFocus, @@ -45,6 +46,12 @@ export const prepareConfigFile = ( ) } + if (highlightLines || notationHighlight) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-highlight.css', url)}"`, + ) + } + if (notationDiff) { imports.push( `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-diff.css', url)}"`, @@ -63,12 +70,6 @@ export const prepareConfigFile = ( ) } - if (notationHighlight) { - imports.push( - `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-highlight.css', url)}"`, - ) - } - if (notationWordHighlight) { imports.push( `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-word-highlight.css', url)}"`, diff --git a/plugins/markdown/plugin-shiki/src/node/prepareConfigFile.ts b/plugins/markdown/plugin-shiki/src/node/prepareConfigFile.ts index 26b58ce9f..4fb0e006b 100644 --- a/plugins/markdown/plugin-shiki/src/node/prepareConfigFile.ts +++ b/plugins/markdown/plugin-shiki/src/node/prepareConfigFile.ts @@ -9,7 +9,8 @@ export const prepareConfigFile = ( app: App, { lineNumbers = true, - collapsedLines, + highlightLines = true, + collapsedLines = 'disable', notationDiff, notationErrorLevel, notationFocus, @@ -31,6 +32,12 @@ export const prepareConfigFile = ( ) } + if (highlightLines || notationHighlight) { + imports.push( + `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-highlight.css', url)}"`, + ) + } + if (notationDiff) { imports.push( `import "${getRealPath('@vuepress/highlighter-helper/styles/notation-diff.css', url)}"`,