+ var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
+ var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
+ var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
+
+ return function(cm, start) {
+ var line = start.line, ch = start.ch, lineText = cm.getLine(line);
+
+ function nextLine() {
+ if (line >= cm.lastLine()) return;
+ ch = 0;
+ lineText = cm.getLine(++line);
+ return true;
+ }
+ function toTagEnd() {
+ for (;;) {
+ var gt = lineText.indexOf(">", ch);
+ if (gt == -1) { if (nextLine()) continue; else return; }
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ theme: "night",
+ extraKeys: {
+ "F11": function(cm) {
+ setFullScreen(cm, !isFullScreen(cm));
+ },
+ "Esc": function(cm) {
+ if (isFullScreen(cm)) setFullScreen(cm, false);
+ }
+ }
+ });
+ </script>
+
+ <p>Press <strong>F11</strong> when cursor is in the editor to toggle full screen editing. <strong>Esc</strong> can also be used to <i>exit</i> full screen editing.</p>
+ <li>Type an html tag. If you press Ctrl+Space a hint panel show the code suggest. You can type to autocomplete tags, attributes if your cursor are inner a tag or attribute values if your cursor are inner a attribute value.</li>
+ <p>CodeMirror is a code-editor component that can be embedded in Web pages. The core library provides <em>only</em> the editor component, no accompanying buttons, auto-completion, or other IDE functionality. It does provide a rich API on top of which such functionality can be straightforwardly implemented. See the <a href="#addons">add-ons</a> included in the distribution, and the <a href="https://github.com/jagthedrummer/codemirror-ui">CodeMirror UI</a> project, for reusable implementations of extra features.</p>
+
+ <p>CodeMirror works with language-specific modes. Modes are JavaScript programs that help color (and optionally indent) text written in a given language. The distribution comes with a number of modes (see the <a href="../mode/"><code>mode/</code></a> directory), and it isn't hard to <a href="#modeapi">write new ones</a> for other languages.</p>
+</body>
+</textarea></form>
+
+ <p>This page uses a hack on top of the <code>"renderLine"</code>
+ event to make wrapped text line up with the base indentation of
+ the line.</p>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ lineWrapping: true,
+ mode: "text/html"
+ });
+ var charWidth = editor.defaultCharWidth(), basePadding = 4;
+ <form><textarea id="code" name="code"># A First Level Header
+
+**Bold** text in a normal-size paragraph.
+
+And a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long, wrapped line with a piece of **big** text inside of it.
+
+## A Second Level Header
+
+Now is the time for all good men to come to
+the aid of their country. This is just a
+regular paragraph.
+
+The quick brown fox jumped over the lazy
+dog's back.
+
+### Header 3
+
+> This is a blockquote.
+>
+> This is the second paragraph in the blockquote.
+>
+> ## This is an H2 in a blockquote
+</textarea></form>
+ <script id="script">
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ <li>Fix right-click select-all on most browsers.</li>
+ <li>Change the way highlighting happens:<br> Saves memory and CPU cycles.<br> <code>compareStates</code> is no longer needed.<br> <code>onHighlightComplete</code> no longer works.</li>
+ <li>Integrate mode (Markdown, XQuery, CSS, sTex) tests in central testsuite.</li>
+ <li>Add a <a href="manual.html#version"><code>CodeMirror.version</code></a> property.</li>
+ <li>More robust handling of nested modes in <a href="../demo/formatting.html">formatting</a> and <a href="../demo/closetag.html">closetag</a> plug-ins.</li>
+ <li>Un/redo now preserves <a href="manual.html#markText">marked text</a> and bookmarks.</li>
+ <li><a href="https://github.com/marijnh/CodeMirror/compare/v2.33...v2.34">Full list</a> of patches.</li>
+ <li>New modes: <a href="../mode/ocaml/index.html">OCaml</a>, <a href="../mode/haxe/index.html">Haxe</a>, and <a href="../mode/vb/index.html">VB.NET</a>.</li>
+ <li>Several fixes to the new scrolling model.</li>
+ <li>Add a <a href="manual.html#setSize"><code>setSize</code></a> method for programmatic resizing.</li>
+ <li>Add <a href="manual.html#getHistory"><code>getHistory</code></a> and <a href="manual.html#setHistory"><code>setHistory</code></a> methods.</li>
+ <li>Allow custom line separator string in <a href="manual.html#getValue"><code>getValue</code></a> and <a href="manual.html#getRange"><code>getRange</code></a>.</li>
+ <li>Support double- and triple-click drag, double-clicking whitespace.</li>
+ <li>Dragging text inside the editor now moves, rather than copies.</li>
+ <li>Add a <a href="manual.html#coordsFromIndex"><code>coordsFromIndex</code></a> method.</li>
+ <li><strong>API change</strong>: <code>setValue</code> now no longer clears history. Use <a href="manual.html#clearHistory"><code>clearHistory</code></a> for that.</li>
+ <li><strong>API change</strong>: <a href="manual.html#markText"><code>markText</code></a> now
+ returns an object with <code>clear</code> and <code>find</code>
+ methods. Marked text is now more robust when edited.</li>
+ <li>Fix editing code with tabs in Internet Explorer.</li>
+ <li>Adds support for <a href="contrib/java">Java</a>.</li>
+ <li>Small additions to the <a href="contrib/php">PHP</a> and <a href="contrib/sql">SQL</a> parsers.</li>
+ <li>Work around various <a href="https://bugs.webkit.org/show_bug.cgi?id=47806">Webkit</a> <a href="https://bugs.webkit.org/show_bug.cgi?id=23474">issues</a>.</li>
+ <li>Fix <code>toTextArea</code> to update the code in the textarea.</li>
+ <li>Add a <code>noScriptCaching</code> option (hack to ease development).</li>
+ <li>Make sub-modes of <a href="mixedtest.html">HTML mixed</a> mode configurable.</li>
+ <li>There are now parsers for <a href="contrib/scheme/index.html">Scheme</a>, <a href="contrib/xquery/index.html">XQuery</a>, and <a href="contrib/ometa/index.html">OmetaJS</a>.</li>
+ <li>Makes <code>height: "dynamic"</code> more robust.</li>
+ <li>Fixes bug where paste did not work on OS X.</li>
+ <li>Add a <code>enterMode</code> and <code>electricChars</code> options to make indentation even more customizable.</li>