modxcms/evolution — pull request #309 by juliolopez78 (2014-07-17 12:04:56+00:00)
Title: Fixed CodeMirror syntax HTML entity highlighting

As I mentioned in [issue #308](https://github.com/modxcms/evolution/issues/308), the current implementation of CodeMirror breaks when HTML entities exist in the editor. Since **&ndash;** is similar enough to **¶m=\`value\`** and the plugin's code only tests for the existence of an ampersand (see removed line 154), I've modified the appropriate conditional to use a regular expression as opposed to a simple text match. Additionally, the `while` loop is no longer necessary since the **Token.match()** method consumes the matched string.

Please see the [CodeMirror mode API documentation](http://codemirror.net/doc/manual.html#modeapi) for more details on the **Token.match()** method.