trailingspace.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!doctype html>
  2. <title>CodeMirror: Trailing Whitespace Demo</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="../addon/edit/trailingspace.js"></script>
  8. <style type="text/css">
  9. .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
  10. .cm-trailingspace {
  11. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==);
  12. background-position: bottom left;
  13. background-repeat: repeat-x;
  14. }
  15. </style>
  16. <div id=nav>
  17. <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
  18. <ul>
  19. <li><a href="../index.html">Home</a>
  20. <li><a href="../doc/manual.html">Manual</a>
  21. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  22. </ul>
  23. <ul>
  24. <li><a class=active href="#">Trailing Whitespace</a>
  25. </ul>
  26. </div>
  27. <article>
  28. <h2>Trailing Whitespace Demo</h2>
  29. <form><textarea id="code" name="code">This text
  30. has some
  31. trailing whitespace!</textarea></form>
  32. <script>
  33. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  34. lineNumbers: true,
  35. showTrailingSpace: true
  36. });
  37. </script>
  38. <p>Uses
  39. the <a href="../doc/manual.html#addon_trailingspace">trailingspace</a>
  40. addon to highlight trailing whitespace.</p>
  41. </article>