diff --git a/packages/client/setup/monaco.ts b/packages/client/setup/monaco.ts index 05f480521f..4119e57389 100644 --- a/packages/client/setup/monaco.ts +++ b/packages/client/setup/monaco.ts @@ -92,7 +92,7 @@ const setup = createSingletonPromise(async () => { monaco.languages.register({ id: 'typescript' }) monaco.languages.register({ id: 'javascript' }) - const { shiki, themes, shikiToMonaco } = await import('#slidev/shiki') + const { shiki, langs, themes, shikiToMonaco } = await import('#slidev/shiki') const highlighter = await shiki const editorOptions: MonacoSetupReturn['editorOptions'] & object = {} @@ -113,6 +113,10 @@ const setup = createSingletonPromise(async () => { : themes.light || 'vitesse-light') }) } + // Register all languages, otherwise Monaco will not highlight them + for (const lang of langs) { + monaco.languages.register({ id: lang }) + } return { monaco,