Open HawkenKing opened 5 years ago
Does your string use the literal sting \n
? For example:
The quick brown fox
Jumped over the lazy dog.
vs.
The quick brown fox\n\nJumped over the lazy dog.
I have the same problem, I use the 2nd version
Ah, you should use the top method to export newline chars. There's no real easy way to detect the string \n
as a newline char instead of the literal sting itself, so I can't do much to support that without making string exports go through a bunch of hoops unfortunately.
Actually, json unesacpe is able to do so, e.g this tool
Hmm, I just tried the following string with that tool: Test\n2
And got the escaped string: Test\\n2
Which is what ESD does. I wasn't saying it's difficult to detect the newline char and escape it as \n
, I was saying it would be complicated to detect the string \n
as a newline char because it is made up of two chars (\
and n
) instead of one char (\n
) and that may be intentional on the user's part so I'm hesitant to inject forced interpretation into the parser.
You should be using unescape, not escape. But what I meant is , is there a way to disable this auto escape?
Hi @Synthoid could you clarify "top method"?
I used the plugin last year (and before) with no problems, it always kept \n
now it makes \\n
in the output, which isn't parseable json.
I'm using this for making language files in games, I need to decide with the translators where carriage returns are with \n so need this in the output, can't use visual carriage returns (which close the cell in docs anyway)
@HawkenKing By top method, I mean using standard visual carriages in your cell:
Like
This
Instead of:
Like\n\nThis
You can make newlines like this by pressing ctrl
+ enter
when editing the cell, with those newline chars being escaped as a \n
char in the exported JSON. Last year, I updated the way JSON was built to use the standard JSON utility in JavaScript instead of manually building a string myself. That fixed a bunch of overlooked formatting issues that the old method had. This ensures the JSON is valid, but can lead to some undesired data changes for longtime users. For that I apologize!
@imtrobin I am hesitant to disable auto escape, as that will affect JSON formatting for all values. Yet given that the point of ESD is to be able to configure your data, I suppose it couldn't hurt. I'm reopening this issue for the time being.
is there a setting to make it stay as \n?