The json module will eat any newlines in strings even if they were appropriately quoted.
The bottom line is that if you have json formatted text, with properly quoted newlines, decoding that text to json will eliminate encoded newlines and other characters that should be preserved, replacing them with one space and if it was a newline, it will be converted to " n". Tabs become a space and a t so \\t = " t".
I tried to track it down and even though I might have massively misunderstood:
For the file:
./plugins/json/source/lua_cjson.c
Line 413 designates newlines, tabs, returns are whitespace.
Line 1017 eats all designated whitespace characters. Effectively replacing them with spaces......I think.
Comments
I just did a quick test like: