mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-23 01:44:31 -06:00
adhere to language ascription in highlightjs
This commit is contained in:
parent
9dbb1dbe8a
commit
36d9b238cf
@ -1886,8 +1886,12 @@ EasyMDE.prototype.markdown = function (text) {
|
|||||||
|
|
||||||
/* Check if HLJS loaded */
|
/* Check if HLJS loaded */
|
||||||
if (hljs) {
|
if (hljs) {
|
||||||
markedOptions.highlight = function (code) {
|
markedOptions.highlight = function (code, language) {
|
||||||
|
if (language && hljs.getLanguage(language)) {
|
||||||
|
return hljs.highlight(language, code).value;
|
||||||
|
} else {
|
||||||
return hljs.highlightAuto(code).value;
|
return hljs.highlightAuto(code).value;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user