From 2ea31416c515c0a532997baf7b8c1aa15ba5de4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edison=20Pe=C3=B1uela?= Date: Sun, 6 Jun 2021 00:37:54 -0500 Subject: [PATCH] fix csv newline characters at export --- services/utils/csvParser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/utils/csvParser.js b/services/utils/csvParser.js index 8853d30..2514a6a 100644 --- a/services/utils/csvParser.js +++ b/services/utils/csvParser.js @@ -39,7 +39,9 @@ function jsonToCsv(data, headers) { if ( typeof element === "string" && - (element.includes(",") || element.includes('"')) + (element.includes("\n") || + element.includes(",") || + element.includes('"')) ) { return `"${escapeQuote(element)}"`; }