Skip to content

Instantly share code, notes, and snippets.

@markrian
Created March 5, 2015 18:54
Show Gist options
  • Save markrian/b07b6b7c2a628958ad98 to your computer and use it in GitHub Desktop.
Save markrian/b07b6b7c2a628958ad98 to your computer and use it in GitHub Desktop.
<!doctype html>
<title>CodeMirror: Oddness Demo</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../doc/docs.css">
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
<ul>
<li><a href="../index.html">Home</a>
<li><a href="../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a class=active href="#">Oddness</a>
</ul>
</div>
<article>
<h2>Oddness</h2>
<form><textarea id="code" name="code"></textarea></form>
<p>Enter three consecutive spaces, and witness the creation of a special char (turns out it's a non-breaking space). Why does it appear?</p>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineWrapping: true,
specialChars: /[\t\u0000-\u0019\u00a0\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g
});
</script>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment