From 4f3163286318010fb3fd0915ab8f990c92f79cbe Mon Sep 17 00:00:00 2001 From: tmdoit Date: Fri, 3 Apr 2020 16:10:33 +0200 Subject: [PATCH] Fix: Allow CR and LF control chars to be a part of the value (#2526) To properly parse CSV data. --- packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js b/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js index 0424e1e9b..fe39f4c59 100644 --- a/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js +++ b/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js @@ -187,7 +187,7 @@ module.exports = function(RED) { // if separator is last char in processing string line (without end of line), add null value at the end - example: '1,2,3\n3,"3",' k[j] = line.length - 1 === i ? null : ""; } - else if ((line[i] === "\n") || (line[i] === "\r")) { // handle multiple lines + else if (((line[i] === "\n") || (line[i] === "\r")) && f) { // handle multiple lines //console.log(j,k,o,k[j]); if (!node.goodtmpl) { node.template[j] = "col"+(j+1); } if ( node.template[j] && (node.template[j] !== "") ) {