Browse Source

Update highlight.js examples to new, preferred, calling convention. See https://github.com/highlightjs/highlight.js/issues/2277

pull/779/head
matthew.kindid 4 years ago
parent
commit
09ba5e0c27
  1. 4
      README.md

4
README.md

@ -152,7 +152,7 @@ var md = require('markdown-it')({
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
return hljs.highlight(str, { language: lang).value;
} catch (__) {}
}
@ -172,7 +172,7 @@ var md = require('markdown-it')({
if (lang && hljs.getLanguage(lang)) {
try {
return '<pre class="hljs"><code>' +
hljs.highlight(lang, str, true).value +
hljs.highlight(str, { language: lang, ignoreIllegals: true).value +
'</code></pre>';
} catch (__) {}
}

Loading…
Cancel
Save