diff --git a/packages/renderer/MdToHtml.ts b/packages/renderer/MdToHtml.ts
index 042a6ad90a..6a81c04e8a 100644
--- a/packages/renderer/MdToHtml.ts
+++ b/packages/renderer/MdToHtml.ts
@@ -467,7 +467,8 @@ export default class MdToHtml {
hlCode = this.cachedHighlightedCode_[cacheKey];
} else {
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 {
hlCode = hljs.highlightAuto(trimmedStr).value;
}