CyrusOfEden / CSV.js

A simple, blazing-fast CSV parser and encoder. Full RFC 4180 compliance.
MIT License
1.54k stars 95 forks source link

Parse wrong when cell tail with two spaces on min.js version #26

Closed muzuiget closed 9 years ago

muzuiget commented 9 years ago

If a cell has two lines, and the first line tail with two spaces, for example

1,"test  
abc"
2,"test  
abc"
3,"test  
abc"

There are two space after test, What expect to get is

 [["1", "test \nabc"], ["2", "test \nabc"], ["3", "test \nabc"]]

It work fine in version 3.6.1 csv.js.

But when using csv.min.js, I got

 [["1,"test", "", ""], ["abc"", undefined, undefined], ["2,"test", "", ""], ["abc"", undefined, undefined], ["3,"test", "", ""], ["abc"", undefined, undefined]]

It doesn't make sense. And I use uglify-js create a min.js myself, it didn't have this bug.

CyrusOfEden commented 9 years ago

Can you upload your version as a pull request? I'll merge ASAP.