3 ms·
JS (and JSON by extension) does not have multi-line strings, so line endings are already escaped. All you need to do is output ‘non-pretty’ json.
by ricardobeat 9y ago
JS (and JSON by extension) does not have multi-line strings, so line endings are already escaped. All you need to do is output ‘non-pretty’ json.
- pkulak 9y agoNice catch, thanks! I didn't realize that. Looks like no control characters are allowed in JSON string literals.