Better log on if language hint was provided

This commit is contained in:
Edward Shen 2022-01-16 00:03:34 -08:00
parent faac1936a9
commit 41d7feb4df
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -109,7 +109,11 @@ function createStringPasteUi(data, mimeType: string, name?: string, lang?: strin
let languages = undefined;
if (!hljs.getLanguage(lang)) {
console.warn(`[js] User provided language (${lang}) is not known.`);
if (lang) {
console.warn(`[js] User provided language (${lang}) is not known.`);
} else {
console.info(`[js] Language hint not provided.`);
}
} else {
languages = [lang];
}