Closed
Description
If you're interested in cutting another dependency, you can use something like:
function highlight(code, lang) {
var dummy = document.createElement('div');
CodeMirror.runMode(code, lang, dummy);
return dummy.innerHTML;
}
to perform highlighting instead of hljs. You do have to include all the relevant modes, though.
This has the added benefit of making sure the preview highlighting is identical to the output highlighting.
Metadata
Metadata
Assignees
Labels
No labels