From 162d442b504ddea9e8a34c6ae7d056dbc9b7a741 Mon Sep 17 00:00:00 2001 From: Jamie Seter Date: Tue, 29 Oct 2019 08:22:21 -0400 Subject: [PATCH] ignoreLastRow should take priority in unfinished processing. --- papaparse.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/papaparse.js b/papaparse.js index a3baa5b..c8897fc 100755 --- a/papaparse.js +++ b/papaparse.js @@ -1510,6 +1510,9 @@ License: MIT //No other quotes are found - no other delimiters if (quoteSearch === -1) { + if(ignoreLastRow) + return returnable(); + if(strictQuote) { errors.push({ type: 'Quotes', @@ -1522,16 +1525,14 @@ License: MIT quoteFallThrough = true; break; // fall through to parse as non-quote. } - if (!ignoreLastRow) { - // No closing quote... what a pity - errors.push({ - type: 'Quotes', - code: 'MissingQuotes', - message: 'Quoted field unterminated', - row: data.length, // row has yet to be inserted - index: cursor - }); - } + // No closing quote... what a pity + errors.push({ + type: 'Quotes', + code: 'MissingQuotes', + message: 'Quoted field unterminated', + row: data.length, // row has yet to be inserted + index: cursor + }); return finish(input.substring(cursor + 1)); }