newline character "\n" dropped when using editor
See original GitHub issueGeneral information
- json-editor version: 2.9.0-beta.0
Expected behavior
strings with “\n” in them should retain the “\n” character when loaded in
{
"description": "hello,\n how are you?"
}
Actual behavior
the new line “\n” is stripped from the string. You can enter it back in, but it is dropped when loaded into the tool
{
"description": "hello, how are you?"
}
Steps to reproduce the behavior
import the sample json above and it will drop the \n character. if you convert it to a string \n then it save it. Problem is, \n and \n are two different things.
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Text Editor which shows \r\n? [closed] - Stack Overflow
With Notepad++, you can show end-of-line characters. It shows CR and LF, instead of "\r" and "\n", but it gets the point across....
Read more >Editing string variable value removes newline characters '\n' in ...
Press enter (without modifying variable value), observe the value have been modified and the newline characters '\n' have been removed.
Read more >Why does '\r' (and not '\n') work to replace with a newline in 'vim'?
In vim editor, I want to replace a newline character ( \n ) with two new line characters ( \n\n ) using vim...
Read more >In software source code, why are newline characters inserted ...
For an editor it is just a sequence if strings. Editor only understands newlines inserted using 'enter' key. The reason for this distinguishing...
Read more ><New Line> character in Smartform - SAP Community
If you are looping and adding text to a symbol, then in the field 'Start' at the top right of the page, select...
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
@schmunk42 Texts for description are treated hier.
I found a workaround here
schema:
"description": "hello, \r\n how are you?"
css:
white-space: break-spaces;
Closing as out of scope, feel free to comment/reopen if needed.