fix(build): don't warn on blank lang in fences

pull/1805/head
Divyansh Singh 2 years ago
parent 1ae0596939
commit 99ad162fb7

@ -86,6 +86,7 @@ export async function highlight(
lang = lang =
lang.replace(lineNoRE, '').replace(vueRE, '').toLowerCase() || defaultLang lang.replace(lineNoRE, '').replace(vueRE, '').toLowerCase() || defaultLang
if (lang) {
const langLoaded = highlighter.getLoadedLanguages().includes(lang as any) const langLoaded = highlighter.getLoadedLanguages().includes(lang as any)
if (!langLoaded) { if (!langLoaded) {
console.warn( console.warn(
@ -97,6 +98,7 @@ export async function highlight(
) )
lang = defaultLang lang = defaultLang
} }
}
const lineOptions = attrsToLines(attrs) const lineOptions = attrsToLines(attrs)
const cleanup = (str: string) => const cleanup = (str: string) =>

Loading…
Cancel
Save