shiki
shiki copied to clipboard
don't throw Error 'No language registration for xxx'
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.
PR: #333