[scripts/markdown2htmldoc] load all languages

This commit is contained in:
Dmytro Meleshko 2020-09-06 19:29:03 +03:00
parent df59241a57
commit 03cc0a5221

View file

@ -51,16 +51,15 @@ parser.addArgument('--script', {
let args = parser.parseArgs();
loadPrismLanguages(); // loads all languages
let md = markdownIt({
html: true,
linkify: true,
highlight: (code, lang) => {
if (lang) {
loadPrismLanguages([lang]);
if (Object.prototype.hasOwnProperty.call(Prism.languages, lang)) {
if (lang && Object.prototype.hasOwnProperty.call(Prism.languages, lang)) {
return Prism.highlight(code, Prism.languages[lang], lang);
}
}
return null;
},
});