loadmode plugin does not work over non string modes
captn3m0 opened this issue · 1 comments
captn3m0 commented
The json mode works with the mode being {name:'javascript',json:true}
.
Running
CodeMirror.autoLoadMode(editor,{name:'javascript',json:true});
results in mode being converted to string and not being loaded. A simple type check for mode being an object fixes this (in loadmode.js)
mode = typeof mode == 'object' ? mode.name : mode;
script.src = CodeMirror.modeURL.replace(/%N/g, mode);
captn3m0 commented
Accidentally opened in old repo