From cea69b4ac4bd66185e1bac9eeaeffb808c38da2b Mon Sep 17 00:00:00 2001 From: jbzorg Date: Wed, 18 Nov 2015 15:48:06 +0500 Subject: [PATCH] Fix newline option for delimiter autodetect --- papaparse.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/papaparse.js b/papaparse.js index 681036a..21fd039 100644 --- a/papaparse.js +++ b/papaparse.js @@ -750,7 +750,7 @@ _delimiterError = false; if (!_config.delimiter) { - var delimGuess = guessDelimiter(input); + var delimGuess = guessDelimiter(input, _config.newline); if (delimGuess.successful) _config.delimiter = delimGuess.bestDelimiter; else @@ -890,7 +890,7 @@ return _results; } - function guessDelimiter(input) + function guessDelimiter(input, newline) { var delimChoices = [',', '\t', '|', ';', Papa.RECORD_SEP, Papa.UNIT_SEP]; var bestDelim, bestDelta, fieldCountPrevRow; @@ -903,6 +903,7 @@ var preview = new Parser({ delimiter: delim, + newline: newline, preview: 10 }).parse(input);