.CodeMirror {border: 1px solid black;} .cm-delimit {color: #fa4;}
CodeMirror
Home Manual Code
Multiplexing Parser
Multiplexing Parser Demo
>"> >
>> this is html again
CodeMirror.defineMode("demo", function(config) { return CodeMirror.multiplexingMode( CodeMirror.getMode(config, "text/html"), {open: " >", mode: CodeMirror.getMode(config, "text/plain"), delimStyle: "delimit"} // .. more multiplexed styles can follow here ); }); var editor = CodeMirror.fromTextArea(document.getElementById("code"), { mode: "demo", lineNumbers: true, lineWrapping: true });
Demonstration of a multiplexing mode, which, at certain boundary strings, switches to one or more inner modes. The out (HTML) mode does not get fed the content of the << >> blocks. See the manual and the source for more information.
Parsing/Highlighting Tests: normal , verbose .