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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -