Created
December 30, 2011 00:49
-
-
Save aadsm/1536976 to your computer and use it in GitHub Desktop.
Marked Text gets "corrupted" when there is a matching bracket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <script src="http://codemirror.net/lib/codemirror.js"></script> | |
| <link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css"> | |
| <style> | |
| .highlight { | |
| background-color: yellow; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <textarea>{"test": "here's a simple test"}</textarea> | |
| <script> | |
| CodeMirror.fromTextArea(document.querySelector("textarea"), { | |
| matchBrackets: true | |
| }).markText( | |
| {line: 0, ch: 10}, | |
| {line: 0, ch: 22}, | |
| "highlight" | |
| ); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment