Browse Source

Removed dead code; attempting fix for classic Mac text files

pull/51/head
Matthew Holt 11 years ago
parent
commit
0dac71ba0a
  1. 27
      jquery.parse.js
  2. 4
      tests.js

27
jquery.parse.js

@ -401,7 +401,7 @@ @@ -401,7 +401,7 @@
newRow();
_state.i++;
}
else if (_state.ch == "\n" || _state.ch == "\r")
else if (_state.ch == "\r" || _state.ch == "\n")
newRow();
else
appendCharToField();
@ -409,28 +409,9 @@ @@ -409,28 +409,9 @@
function isBoundary(i)
{
if (i >= _input.length)
return false;
var ch = _input[i];
if (ch == _config.delimiter
|| ch == "\n"
|| (ch == "\r" && i < _input.length - 1 && _input[i+1] == "\n"))
return true;
else
return false;
}
function isLineEnding(i)
{
if (i >= _input.length)
return false;
if (i < _input.length - 1)
return _input[i] == "\n" || (_input[i] == "\r" && _input[i+1] == "\n");
else
return _input[i] == "\n";
return _input[i] == _config.delimiter
|| _input[i] == "\n"
|| _input[i] == "\r";
}
function saveValue()

4
tests.js

@ -166,6 +166,10 @@ var tests = [ @@ -166,6 +166,10 @@ var tests = [
input: "\r\nF1,F2,F3\r\nV1,2,V3",
cases: resultSet1
},
{
input: 'F1,F2,"F3"\n"V1","2",V3',
cases: resultSet1
},
{
input: "F1,F2,F3\nV1,2,V3\nV4,V5,V6",
cases: [

Loading…
Cancel
Save