From 6dd6a59acb68f150f8337800ca24419e4a48fc88 Mon Sep 17 00:00:00 2001 From: Dmitry Sharabin Date: Thu, 29 May 2025 13:57:26 +0200 Subject: [PATCH] Resolve the language if its definition is already loaded, and it is not yet resolved --- src/core/highlight.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/highlight.ts b/src/core/highlight.ts index 79d49b8e76..a65bc50fa9 100644 --- a/src/core/highlight.ts +++ b/src/core/highlight.ts @@ -54,6 +54,10 @@ export function highlight ( language, }; + if (env.languageDef && !env.language) { + env.language = prism.languageRegistry.getLanguage(env.languageDef); + } + prism.hooks.run('before-tokenize', env); if (!env.language) {