5 <title>CodeMirror: Multiplexing Parser Demo</title>
6 <link rel="stylesheet" href="../lib/codemirror.css">
7 <script src="../lib/codemirror.js"></script>
8 <script src="../addon/mode/multiplex.js"></script>
9 <script src="../mode/xml/xml.js"></script>
10 <link rel="stylesheet" href="../doc/docs.css">
12 <style type="text/css">
13 .CodeMirror {border: 1px solid black;}
14 .cm-delimit {color: #fa4;}
18 <h1>CodeMirror: Multiplexing Parser Demo</h1>
20 <form><textarea id="code" name="code">
22 <body style="<<magic>>">
23 <h1><< this is not <html >></h1>
27 at all : &amp; <link/>
29 <p>this is html again</p>
35 CodeMirror.defineMode("demo", function(config) {
36 return CodeMirror.multiplexingMode(
37 CodeMirror.getMode(config, "text/html"),
38 {open: "<<", close: ">>",
39 mode: CodeMirror.getMode(config, "text/plain"),
40 delimStyle: "delimit"}
41 // .. more multiplexed styles can follow here
44 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
51 <p>Demonstration of a multiplexing mode, which, at certain
52 boundary strings, switches to one or more inner modes. The out
53 (HTML) mode does not get fed the content of the <code><<
55 the <a href="../doc/manual.html#addon_multiplex">manual</a> and
56 the <a href="../addon/mode/multiplex.js">source</a> for more
60 <strong>Parsing/Highlighting Tests:</strong>
61 <a href="../test/index.html#multiplexing_*">normal</a>,
62 <a href="../test/index.html#verbose,multiplexing_*">verbose</a>.