Browse Source

Fix Issue #514 "Line ends with quoted field, first field of next line is empty"

pull/515/head
Barrie Treloar 7 years ago
parent
commit
bbdb18d6bf
  1. 6
      papaparse.js

6
papaparse.js

@ -1439,9 +1439,11 @@ @@ -1439,9 +1439,11 @@
continue;
}
var spacesBetweenQuoteAndDelimiter = extraSpaces(nextDelim);
// Check up to nextDelim or nextNewline, whichever is closest
var checkUpTo = nextNewline === -1 ? nextDelim : Math.min(nextDelim, nextNewline);
var spacesBetweenQuoteAndDelimiter = extraSpaces(checkUpTo);
// Closing quote followed by delimiter or 'unnecessary steps + delimiter'
// Closing quote followed by delimiter or 'unnecessary spaces + delimiter'
if (input[quoteSearch + 1 + spacesBetweenQuoteAndDelimiter] === delim)
{
row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar));

Loading…
Cancel
Save