mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts] handle non-existing languages in markdown2htmldoc
This commit is contained in:
parent
97764cfaa7
commit
d4e04125a6
1 changed files with 3 additions and 2 deletions
|
@ -28,8 +28,9 @@ let md = markdownIt({
|
|||
highlight: (str, lang) => {
|
||||
if (lang.length > 0) {
|
||||
loadPrismLanguages([lang]);
|
||||
let h = Prism.highlight(str, Prism.languages[lang], lang);
|
||||
return h;
|
||||
if (Object.prototype.hasOwnProperty.call(Prism.languages, lang)) {
|
||||
return Prism.highlight(str, Prism.languages[lang], lang);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue