File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
src/node/markdown/plugins Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
- # [ 2.0.0-alpha.3] ( https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.2...v2.0.0-alpha.3 ) (2025-02-24)
1
+ ## [ 2.0.0-alpha.3] ( https://github.com/vuejs/vitepress/compare/v2.0.0-alpha.2...v2.0.0-alpha.3 ) (2025-02-24)
2
2
3
3
### Bug Fixes
4
4
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ import {
7
7
type TransformerCompactLineOption
8
8
} from '@shikijs/transformers'
9
9
import { customAlphabet } from 'nanoid'
10
- import type { ShikiTransformer , BundledLanguage } from 'shiki'
11
- import { createHighlighter , guessEmbeddedLanguages } from 'shiki'
10
+ import c from 'picocolors'
11
+ import type { BundledLanguage , ShikiTransformer } from 'shiki'
12
+ import { createHighlighter , guessEmbeddedLanguages , isSpecialLang } from 'shiki'
12
13
import type { Logger } from 'vite'
13
14
import type { MarkdownOptions , ThemeOptions } from '../markdown'
14
- import c from 'picocolors'
15
15
16
16
const nanoid = customAlphabet ( 'abcdefghijklmnopqrstuvwxyz' , 10 )
17
17
@@ -111,7 +111,13 @@ export async function highlight(
111
111
. toLowerCase ( ) || defaultLang
112
112
113
113
try {
114
- await highlighter . loadLanguage ( lang as any )
114
+ // https://github.com/shikijs/shiki/issues/952
115
+ if (
116
+ ! isSpecialLang ( lang ) &&
117
+ ! highlighter . getLoadedLanguages ( ) . includes ( lang )
118
+ ) {
119
+ await highlighter . loadLanguage ( lang as any )
120
+ }
115
121
} catch {
116
122
logger . warn (
117
123
c . yellow (
You can’t perform that action at this time.
0 commit comments