fix: improve loading

This commit is contained in:
Anthony Fu 2022-11-24 16:57:24 +08:00
parent 70645180aa
commit dbf4362d8b
4 changed files with 22 additions and 14 deletions

View file

@ -30,6 +30,11 @@ export function highlightCode(code: string, lang: Lang) {
.then(() => {
registeredLang.value.set(lang, true)
})
.catch((e) => {
console.error(`[shiki] Failed to load language ${lang}`)
console.error(e)
registeredLang.value.set(lang, false)
})
return code
}