Quote keys containing special characters
See original GitHub issue- What version of RJEA are you using (react-json-editor-ajrm version)?
v2.4.4
- What operating system and processor architecture are you using?
Mac OS
- What did you do?
Tried to edit a JSON object whose keys have “special characters”.
- What did you expect to see?
An properly editable object
- What did you see instead?
In the above screenshot, when I changed the value of state
to paused
, the error shows up for line 4. I can temporarily fix the error by manually putting the key in quotes (i.e. '10018-00'
), but then the next key that starts with a number or contains other special characters gets marked as an error.
Could you please provide a fix to this? One possible fix would be to always quote keys that will cause parsing errors if left unquoted; or to just always quote keys.
Cheers!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Special Characters – iA
You can type many special characters, including diacritics and “”-style quotation marks, using keyboard shortcuts. The shortcuts vary with keyboard layout, ...
Read more >Using Quotes with YAML Special Characters
Use quotes in YAML if your value includes special characters. ... special character is surrounded by spaces, for example, * with spaces on...
Read more >Special Characters and Quoting - Learning the bash ... - O'Reilly
Sometimes you will want to use special characters literally, i.e., without their special meanings. This is called quoting. If you surround a string...
Read more >3.3. Quoting characters
A lot of keys have special meanings in some context or other. Quoting is used to remove the special meaning of characters or...
Read more >ASCII and Unicode quotation marks
If you can use Unicode characters, nice directional quotation marks are available in the form of characters U+2018, U+2019, U+201C, and U+201D (as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @ellis, special key names that require to be wrapped in quotes now do. Hey @PatrickSachs, quotes in keys are now escaped.
This fixes are available in the latest version of
react-json-editor-ajrm@2.4.7
Since this is probably the same issue, quotes in keys also need to be escaped:
Creates the following output: (Syntax Error in the second line:
Missing closing ' quote on key at line 2
)