I was trying runmode-standalone
which displays the output but doesnt highlight.
CodeMirror.runMode(box.value, 'text/javascript', document.querySelector('pre'));
--- or ---
CodeMirror.runMode(box.value, 'javascript', document.querySelector('pre'));
I was trying runmode-standalone
which displays the output but doesnt highlight.
CodeMirror.runMode(box.value, 'text/javascript', document.querySelector('pre'));
--- or ---
CodeMirror.runMode(box.value, 'javascript', document.querySelector('pre'));
Possibly you didn’t load the mode or the style sheets, or the style sheets you loaded don’t match the actual tokens. Hard to say from what you provided.
I found out the problem was with the order of loading the codemirror scripts…
AFA mode, which one is correct, ‘text/javascript’ or ‘javascript’?
Those are exactly equivalent if using the JS mode in the distribution.