From 37c2100182e8155d599652e8fee505465272505e Mon Sep 17 00:00:00 2001 From: Simon Hilz Date: Fri, 2 Sep 2016 10:56:25 +0200 Subject: [PATCH] char replacement if non default quoteChar --- papaparse.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/papaparse.js b/papaparse.js index 4dd12bb..758026c 100644 --- a/papaparse.js +++ b/papaparse.js @@ -1128,7 +1128,7 @@ if (quoteSearch === inputLen-1) { // Closing quote at EOF - var value = input.substring(cursor, quoteSearch).replace(quoteCharRegex, '"'); + var value = input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar); return finish(value); } @@ -1142,7 +1142,7 @@ if (input[quoteSearch+1] === delim) { // Closing quote followed by delimiter - row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, '"')); + row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar)); cursor = quoteSearch + 1 + delimLen; nextDelim = input.indexOf(delim, cursor); nextNewline = input.indexOf(newline, cursor); @@ -1152,7 +1152,7 @@ if (input.substr(quoteSearch+1, newlineLen) === newline) { // Closing quote followed by newline - row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, '"')); + row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar)); saveRow(quoteSearch + 1 + newlineLen); nextDelim = input.indexOf(delim, cursor); // because we may have skipped the nextDelim in the quoted field