mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts/markdown2htmldoc] load all languages
This commit is contained in:
parent
df59241a57
commit
03cc0a5221
1 changed files with 4 additions and 5 deletions
|
@ -51,15 +51,14 @@ parser.addArgument('--script', {
|
||||||
|
|
||||||
let args = parser.parseArgs();
|
let args = parser.parseArgs();
|
||||||
|
|
||||||
|
loadPrismLanguages(); // loads all languages
|
||||||
|
|
||||||
let md = markdownIt({
|
let md = markdownIt({
|
||||||
html: true,
|
html: true,
|
||||||
linkify: true,
|
linkify: true,
|
||||||
highlight: (code, lang) => {
|
highlight: (code, lang) => {
|
||||||
if (lang) {
|
if (lang && Object.prototype.hasOwnProperty.call(Prism.languages, lang)) {
|
||||||
loadPrismLanguages([lang]);
|
return Prism.highlight(code, Prism.languages[lang], lang);
|
||||||
if (Object.prototype.hasOwnProperty.call(Prism.languages, lang)) {
|
|
||||||
return Prism.highlight(code, Prism.languages[lang], lang);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue