Browse Source

Using latest (4.0.2)

pull/180/head
Matthew Holt 11 years ago
parent
commit
1c7672b788
  1. 14
      resources/js/papaparse.js

14
resources/js/papaparse.js

@ -1,6 +1,6 @@
/* /*
Papa Parse Papa Parse
v4.0.1 v4.0.2
https://github.com/mholt/PapaParse https://github.com/mholt/PapaParse
*/ */
(function(global) (function(global)
@ -1187,7 +1187,8 @@
if (input.substr(quoteSearch+1, newlineLen) == newline && hasCloseQuote(input.substring(cursor, quoteSearch+1))) if (input.substr(quoteSearch+1, newlineLen) == newline && hasCloseQuote(input.substring(cursor, quoteSearch+1)))
{ {
// Closing quote followed by newline // Closing quote followed by newline
saveRow(quoteSearch, quoteSearch + 1 + newlineLen); row.push(input.substring(cursor, quoteSearch).replace(/""/g, '"'));
saveRow(quoteSearch + 1 + newlineLen);
if (stepIsFunction) if (stepIsFunction)
{ {
@ -1229,7 +1230,8 @@
// End of row // End of row
if (nextNewline != -1) if (nextNewline != -1)
{ {
saveRow(nextNewline, nextNewline + newlineLen); row.push(input.substring(cursor, nextNewline));
saveRow(nextNewline + newlineLen);
if (stepIsFunction) if (stepIsFunction)
{ {
@ -1263,14 +1265,12 @@
return returnable(); return returnable();
} }
// Appends input from cursor to fromCursorToHere to row, // Appends the current row to the results. It sets the cursor
// then appends the row to the results. It sets the cursor
// to newCursor and finds the nextNewline. The caller should // to newCursor and finds the nextNewline. The caller should
// take care to execute user's step function and check for // take care to execute user's step function and check for
// preview and end parsing if necessary. // preview and end parsing if necessary.
function saveRow(fromCursorToHere, newCursor) function saveRow(newCursor)
{ {
row.push(input.substring(cursor, fromCursorToHere));
data.push(row); data.push(row);
row = []; row = [];
cursor = newCursor; cursor = newCursor;

Loading…
Cancel
Save