File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 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'
44import type { Highlighter , MdcConfig , ModuleOptions as MDCModuleOptions } from '@nuxtjs/mdc'
55import type { Nuxt } from '@nuxt/schema'
66import { resolveAlias } from '@nuxt/kit'
7+ import type { LanguageRegistration } from 'shiki'
78import { defu } from 'defu'
89import { createOnigurumaEngine } from 'shiki/engine/oniguruma'
910import { visit } from 'unist-util-visit'
@@ -52,8 +53,8 @@ async function _getHighlightPlugin(options: HighlighterOptions) {
5253 typeof theme === 'string' ? ( await import ( `shiki/themes/${ theme } .mjs` ) . then ( m => m . default || m ) ) : theme ,
5354 ] ) )
5455 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 ,
5758 ] ) )
5859
5960 const highlighter = createShikiHighlighter ( {
You can’t perform that action at this time.
0 commit comments