javascript - Highlight invalid tokens when parsing JSON on a web editor (Codemirror, Ace) -


ace editor , code mirror, both incredibly web code editors. however, both of error highlighting line-based (reported on line gutter)

i'm using editors json, , i'm looking way highlight errors based on tokens, similar how sublime highlights json:

enter image description here

enter image description here

enter image description here

enter image description here

notice in above, sublime highlights errant tokens. want achieve same thing in ace or codemirror.

one way think it, codemirror has marktext command can 'mark' text (add css) based on position. guess can use if had regex match invalid tokens.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -