mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bug-fix: fix code block highlight issues
add ignore_illegals parameter to hljs.highlight().
This commit is contained in:
parent
3ce7ef28c1
commit
faff0cd8f6
@ -5,7 +5,7 @@ marked.setOptions({
|
||||
highlight: function(code, lang) {
|
||||
if (lang) {
|
||||
if (hljs.getLanguage(lang)) {
|
||||
return hljs.highlight(lang, code).value;
|
||||
return hljs.highlight(lang, code, true).value;
|
||||
} else {
|
||||
return hljs.highlightAuto(code).value;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ var mdit = window.markdownit({
|
||||
&& (!VEnableMermaid || lang != 'mermaid')
|
||||
&& (!VEnableFlowchart || lang != 'flowchart')) {
|
||||
if (hljs.getLanguage(lang)) {
|
||||
return hljs.highlight(lang, str).value;
|
||||
return hljs.highlight(lang, str, true).value;
|
||||
} else {
|
||||
return hljs.highlightAuto(str).value;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ marked.setOptions({
|
||||
&& (!VEnableMermaid || lang != 'mermaid')
|
||||
&& (!VEnableFlowchart || lang != 'flowchart')) {
|
||||
if (hljs.getLanguage(lang)) {
|
||||
return hljs.highlight(lang, code).value;
|
||||
return hljs.highlight(lang, code, true).value;
|
||||
} else {
|
||||
return hljs.highlightAuto(code).value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user