incubator-couchdb-user mailing list archives

On 12/11/2012 04:04 PM, Benoit Chesneau wrote:
> Hello,
>
> I am actually working on a couchapp and need to add a json editor to it.
> Any idea about it ? Maybe something that could work with codemirror but
> that isn't a strong requirement.
>
> Anyway any recommendation is appreciated.
>
> - benoît
>
Hi Benoit,
I've created a JSON mode for CodeMirror2 ages ago, but never found the
time to get it release ready. I squashed it into two sensible commits
[1] . Please note that it only works with CodeMirror2 2.33 as
"onHighlightComplete" got broken afterwards [2]. But it's probably not
to hard to get it working again. You probably want to port it to
CodeMirror3 anyway.
To try it, just open mode/json/index.html. The visual errors it supports
is trailing and missing commas in objects and duplicated keys.
[1] https://github.com/vmx/CodeMirror2/tree/json-mode
[2] http://codemirror.net/2/doc/oldrelease.html
Cheers,
Volker