Edit a value in a plain text area (handling special characters like \n)
Seems like the jsoneditor (version 9.1.10) doesn't allow user to see and edit the real json string. User has to think about json escaping rules. This makes very hard to edit the strings with a large number of " and \ characters (i.e., the peaces of code with own escaping).
The most logical place to show and edit the unescaped (real) string is string editor in tree mode. But does not provide this. And moreover, jsoneditor tries to automatically fix the escaping after editing and it brakes some strings like: x = "the \"x\" is 'the \\\"x\\\" value'";
Is it possible to switch tree mode to use real string values instead of json-escaped ones?
Thanks , this is a relevant question indeed.
See also #137, #141.
Some characters can be displayed as the "orginal" version instead of the escaped version, but others are troublesome, like \n and \t. JSONEditor right now consequently displays the escaped version indeed. One solution could be allowing you to determine how values are rendered yourself (#738).
If anyone has ideas to solve this I would love to hear.
Well, one of the possible solution is to make the detailed area with the real unescaped value of selected note under the jsoneditor element (I think it could be implemented externally with the callbacks provided by jsoneditor, but don't have enough experience to do it). But the better solution could be expandable editor opened by some button.
Like this (after clicking the expand icon, jsoneditor switches to the texteditor mode and returns to the tree mode after losing focus, or by breadcrumbs click):

That is an definitely and interesting idea. Maybe a popup with a plain text area would also work nice (instead of a full screen text area).
I think we have to think through the button to open this text field a bit more. I guess it should not be visible on every field all the time, but only on the field that currently has focus (else it becomes too busy).
I'll adjust the title to reflect your idea
Hello, The unescaped editor feature isn't implemented yet?
It's fun that you ask. The feature is indeed not yet implemented in the jsoneditor library. Just this week though I started implementing two new options in svelte-jsoneditor to configure whether to escape control characters and/or unicode characters, that will be available in this new editor within a few weeks I think. I discovered the CSS feature white-space: pre-wrap;, that allows properly rendering control characters like newline and tab, exactly what we need here 😄.
Sounds good. Actually, I was surprised when I didn't find this useful feature in any existing JSON GUI editors.
Ok so escaping control and unicode characters is now a configuration option in svelte-jsoneditor. You can try it out in the beta web application: https://jsoneditoronline.org/beta/

Wow, it's very convenient. Perfect, that's what I was looking for. Thanks.
👍 I like it too!