shiki icon indicating copy to clipboard operation
shiki copied to clipboard

don't throw Error 'No language registration for xxx'

Open gittig11 opened this issue 2 years ago • 1 comments

When I call getGrammar('mjs') in packages\shiki\src\highlighter.ts, error occurs: No language registration for mjs, which results in a error like 'vitepress build docs' error.

As a result, I pass the default language 'text' to function codeToThemedTokens() when there is no language registration. This will solve the problem.

gittig11 avatar Jul 21 '22 13:07 gittig11

PR: #333

gittig11 avatar Jul 21 '22 13:07 gittig11