Closed TomShriner closed 8 years ago
@TomShriner You could use the handleString
option if you want to remove linebreaks from all strings, but i think another option would be to add the textDelimiter
in the CSV when a linebreak is detected (needs to be tested) https://github.com/Cnova/jsonexport/blob/master/lib/index.js#L122
var options = {
handleString: (string, name) => string.replace(/\n/g, '')
};
I saw an issue where one of my json entries contained a newline - example:
"q10":"blahblahblahe\n",
which seems to not get handled properly. Could I be missing an option to handle this or is there an issue with the character embedded in the string literal (or perhaps my json is not properly escaped - I retrieve via an external API which may be violating the json spec - but it looks right).
It should be valid in JSON to have a string containing a newline.