File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { hash } from 'ohash'
4
4
import type { Highlighter , MdcConfig , ModuleOptions as MDCModuleOptions } from '@nuxtjs/mdc'
5
5
import type { Nuxt } from '@nuxt/schema'
6
6
import { resolveAlias } from '@nuxt/kit'
7
+ import type { LanguageRegistration } from 'shiki'
7
8
import { defu } from 'defu'
8
9
import { createOnigurumaEngine } from 'shiki/engine/oniguruma'
9
10
import { visit } from 'unist-util-visit'
@@ -52,8 +53,8 @@ async function _getHighlightPlugin(options: HighlighterOptions) {
52
53
typeof theme === 'string' ? ( await import ( `shiki/themes/${ theme } .mjs` ) . then ( m => m . default || m ) ) : theme ,
53
54
] ) )
54
55
const bundledLangs = await Promise . all ( langs . map ( async lang => [
55
- lang ,
56
- await import ( `@shikijs/langs/${ lang } ` ) . then ( m => m . default || m ) ,
56
+ typeof lang === 'string' ? lang : ( lang as unknown as LanguageRegistration ) . name ,
57
+ typeof lang === 'string' ? await import ( `@shikijs/langs/${ lang } ` ) . then ( m => m . default || m ) : lang ,
57
58
] ) )
58
59
59
60
const highlighter = createShikiHighlighter ( {
You can’t perform that action at this time.
0 commit comments