diff --git a/papaparse.js b/papaparse.js index 7658de0..b1cb416 100755 --- a/papaparse.js +++ b/papaparse.js @@ -1603,7 +1603,7 @@ License: MIT if (nextDelim !== -1 && (nextDelim < nextNewline || nextNewline === -1)) { // we check, if we have quotes, because delimiter char may be part of field enclosed in quotes - if (quoteSearch !== -1) { + if (quoteSearch > nextDelim) { // we have quotes, so we try to find the next delimiter not enclosed in quotes and also next starting quote char var nextDelimObj = getNextUnqotedDelimiter(nextDelim, quoteSearch, nextNewline); diff --git a/tests/test-cases.js b/tests/test-cases.js index 45db0e6..dadb724 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -670,6 +670,14 @@ var PARSE_TESTS = [ errors: [] } }, + { + description: "Misplaced quotes in data twice, not as opening quotes", + input: 'A,B",C\nD,E",F', + expected: { + data: [['A', 'B"', 'C'], ['D', 'E"', 'F']], + errors: [] + } + }, { description: "Mixed slash n and slash r should choose first as precident", input: 'a,b,c\nd,e,f\rg,h,i\n',