~ubuntu-branches/ubuntu/utopic/codemirror-js/utopic

« back to all changes in this revision

Viewing changes to mode/xml/index.html

  • Committer: Package Import Robot
  • Author(s): David Paleino
  • Date: 2012-04-12 12:25:28 UTC
  • Revision ID: package-import@ubuntu.com-20120412122528-8xp5a8frj4h1d3ee
Tags: upstream-2.23
ImportĀ upstreamĀ versionĀ 2.23

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html>
 
2
<html>
 
3
  <head>
 
4
    <title>CodeMirror: XML mode</title>
 
5
    <link rel="stylesheet" href="../../lib/codemirror.css">
 
6
    <script src="../../lib/codemirror.js"></script>
 
7
    <script src="xml.js"></script>
 
8
    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
 
9
    <link rel="stylesheet" href="../../doc/docs.css">
 
10
  </head>
 
11
  <body>
 
12
    <h1>CodeMirror: XML mode</h1>
 
13
    <form><textarea id="code" name="code">
 
14
&lt;html style="color: green"&gt;
 
15
  &lt;!-- this is a comment --&gt;
 
16
  &lt;head&gt;
 
17
    &lt;title&gt;HTML Example&lt;/title&gt;
 
18
  &lt;/head&gt;
 
19
  &lt;body&gt;
 
20
    The indentation tries to be &lt;em&gt;somewhat &amp;quot;do what
 
21
    I mean&amp;quot;&lt;/em&gt;... but might not match your style.
 
22
  &lt;/body&gt;
 
23
&lt;/html&gt;
 
24
</textarea></form>
 
25
    <script>
 
26
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
 
27
        mode: {name: "xml", alignCDATA: true},
 
28
        lineNumbers: true
 
29
      });
 
30
    </script>
 
31
    <p>The XML mode supports two configuration parameters:</p>
 
32
    <dl>
 
33
      <dt><code>htmlMode (boolean)</code></dt>
 
34
      <dd>This switches the mode to parse HTML instead of XML. This
 
35
      means attributes do not have to be quoted, and some elements
 
36
      (such as <code>br</code>) do not require a closing tag.</dd>
 
37
      <dt><code>alignCDATA (boolean)</code></dt>
 
38
      <dd>Setting this to true will force the opening tag of CDATA
 
39
      blocks to not be indented.</dd>
 
40
    </dl>
 
41
 
 
42
    <p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p>
 
43
  </body>
 
44
</html>