Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
776 lars 1
<!doctype html>
2
<title>CodeMirror: XML mode</title>
3
<meta charset="utf-8" />
4
<link rel=stylesheet href="../../doc/docs.css">
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">
9
    .CodeMirror {
10
        border-top: 1px solid black;
11
        border-bottom: 1px solid black;
12
    }
13
</style>
14
<div id=nav>
15
    <a href="http://codemirror.net">
16
        <h1>CodeMirror</h1>
17
        <img id=logo src="../../doc/logo.png">
18
    </a>
19
    <ul>
20
        <li>
21
            <a href="../../index.html">Home</a>
22
            <li>
23
                <a href="../../doc/manual.html">Manual</a>
24
                <li>
25
                    <a href="https://github.com/codemirror/codemirror">Code</a>
26
    </ul>
27
    <ul>
28
        <li>
29
            <a href="../index.html">Language modes</a>
30
            <li>
31
                <a class=active href="#">XML</a>
32
    </ul>
33
</div>
34
<article>
35
    <h2>XML mode</h2>
36
    <form>
37
        <textarea id="code" name="code"> &lt;html style="color: green"&gt; &lt;!-- this is a comment --&gt; &lt;head&gt; &lt;title&gt;HTML Example&lt;/title&gt; &lt;/head&gt; &lt;body&gt; The indentation tries to be &lt;em&gt;somewhat &amp;quot;do what I mean&amp;quot;&lt;/em&gt;...
38
            but might not match your style. &lt;/body&gt; &lt;/html&gt; </textarea>
39
    </form>
40
    <script>
41
        var editor = CodeMirror.fromTextArea(document.getElementById("code"),
42
        {
43
            mode: "text/html",
44
            lineNumbers: true
45
        });
46
    </script>
47
    <p>The XML mode supports two configuration parameters:</p>
48
    <dl>
49
        <dt><code>htmlMode (boolean)</code></dt>
50
        <dd>This switches the mode to parse HTML instead of XML. This means attributes do not have to be quoted, and some elements (such as <code>br</code>) do not require a closing tag.</dd>
51
        <dt><code>alignCDATA (boolean)</code></dt>
52
        <dd>Setting this to true will force the opening tag of CDATA blocks to not be indented.</dd>
53
    </dl>
54
    <p>
55
        <strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p>
56
</article>