Comparing version 0.8.1 to 0.8.2
@@ -551,5 +551,10 @@ "use strict"; | ||
} else { | ||
let newLang = lang || "text"; | ||
if (!import_lighter2.LANG_NAMES.includes(newLang)) { | ||
console.warn(`Bright warning: Unknown language ${JSON.stringify(lang)}`); | ||
newLang = "text"; | ||
} | ||
return { | ||
code: children || code || "", | ||
lang | ||
lang: newLang | ||
}; | ||
@@ -560,17 +565,18 @@ } | ||
if (!className) { | ||
return { | ||
lang: "text" | ||
}; | ||
return { lang: "text" }; | ||
} | ||
const metastring = className.replace("language-", ""); | ||
const lang = metastring.split(".").pop(); | ||
if (!import_lighter2.LANG_NAMES.includes(lang)) { | ||
console.warn( | ||
`Bright warning: Unknown language ${JSON.stringify( | ||
lang | ||
)} in ${JSON.stringify(metastring)}` | ||
); | ||
return { lang: "text" }; | ||
} | ||
if (lang !== metastring) { | ||
return { | ||
lang, | ||
title: metastring | ||
}; | ||
return { lang, title: metastring }; | ||
} | ||
return { | ||
lang | ||
}; | ||
return { lang }; | ||
} | ||
@@ -577,0 +583,0 @@ // Annotate the CommonJS export names for ESM import in node: |
{ | ||
"name": "bright", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37769
1207