mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-23 01:44:31 -06:00
Merge pull request #203 from cornerman/highlightjs
adhere to language ascription in highlightjs
This commit is contained in:
commit
86d6ce7c6a
@ -1886,8 +1886,12 @@ EasyMDE.prototype.markdown = function (text) {
|
||||
|
||||
/* Check if HLJS loaded */
|
||||
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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user