1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Chore: Fixed highlight.js syntax

Ref: https://github.com/highlightjs/highlight.js/issues/2277
This commit is contained in:
Laurent Cozic 2021-10-04 16:58:26 +01:00
parent e069fe90c8
commit f47478f730

View File

@ -467,7 +467,8 @@ export default class MdToHtml {
hlCode = this.cachedHighlightedCode_[cacheKey]; hlCode = this.cachedHighlightedCode_[cacheKey];
} else { } else {
if (lang && hljs.getLanguage(lang)) { if (lang && hljs.getLanguage(lang)) {
hlCode = hljs.highlight(lang, trimmedStr, true).value; // hlCode = hljs.highlight(lang, trimmedStr, true).value;
hlCode = hljs.highlight(trimmedStr, { language: lang, ignoreIllegals: true }).value;
} else { } else {
hlCode = hljs.highlightAuto(trimmedStr).value; hlCode = hljs.highlightAuto(trimmedStr).value;
} }