htmltest.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <script src="js/codemirror.js" type="text/javascript"></script>
  4. <title>CodeMirror: HTML/XML demonstration</title>
  5. <link rel="stylesheet" type="text/css" href="css/docs.css"/>
  6. <style type="text/css">
  7. .CodeMirror-line-numbers {
  8. width: 2.2em;
  9. color: #aaa;
  10. background-color: #eee;
  11. text-align: right;
  12. padding-right: .3em;
  13. font-size: 10pt;
  14. font-family: monospace;
  15. padding-top: .4em;
  16. }
  17. </style>
  18. </head>
  19. <body style="padding: 20px;">
  20. <p>This is a simple demonstration of the XML/HTML indentation module
  21. for <a href="index.html">CodeMirror</a>. The <a
  22. href="js/parsexml.js">javascript</a> file contains some comments with
  23. more information.</p>
  24. <div class="border">
  25. <textarea id="code" cols="120" rows="30">
  26. &lt;html style="color: green"&gt;
  27. &lt;!-- this is a comment --&gt;
  28. &lt;head&gt;
  29. &lt;title&gt;HTML Example&lt;/title&gt;
  30. &lt;/head&gt;
  31. &lt;body&gt;
  32. The indentation tries to be &lt;em&gt;somewhat &amp;quot;do what
  33. I mean&amp;quot;&lt;/em&gt;... but might not match your style.
  34. &lt;/body&gt;
  35. &lt;/html&gt;
  36. </textarea>
  37. </div>
  38. <script type="text/javascript">
  39. var editor = CodeMirror.fromTextArea('code', {
  40. height: "350px",
  41. parserfile: "parsexml.js",
  42. stylesheet: "css/xmlcolors.css",
  43. path: "js/",
  44. continuousScanning: 500,
  45. lineNumbers: true
  46. });
  47. </script>
  48. </body>
  49. </html>