Browse Source

ignoreLastRow should take priority in unfinished processing.

pull/730/head
Jamie Seter 5 years ago
parent
commit
162d442b50
  1. 21
      papaparse.js

21
papaparse.js

@ -1510,6 +1510,9 @@ License: MIT
//No other quotes are found - no other delimiters //No other quotes are found - no other delimiters
if (quoteSearch === -1) if (quoteSearch === -1)
{ {
if(ignoreLastRow)
return returnable();
if(strictQuote) { if(strictQuote) {
errors.push({ errors.push({
type: 'Quotes', type: 'Quotes',
@ -1522,16 +1525,14 @@ License: MIT
quoteFallThrough = true; quoteFallThrough = true;
break; // fall through to parse as non-quote. break; // fall through to parse as non-quote.
} }
if (!ignoreLastRow) { // No closing quote... what a pity
// No closing quote... what a pity errors.push({
errors.push({ type: 'Quotes',
type: 'Quotes', code: 'MissingQuotes',
code: 'MissingQuotes', message: 'Quoted field unterminated',
message: 'Quoted field unterminated', row: data.length, // row has yet to be inserted
row: data.length, // row has yet to be inserted index: cursor
index: cursor });
});
}
return finish(input.substring(cursor + 1)); return finish(input.substring(cursor + 1));
} }

Loading…
Cancel
Save