mholt / PapaParse

Fast and powerful CSV (delimited text) parser that gracefully handles large files and malformed input
http://PapaParse.com
MIT License
12.3k stars 1.14k forks source link

`Papa.parse()`: `comments` option breaks for quoted cells #1031

Open NamesMT opened 7 months ago

NamesMT commented 7 months ago

If we force quotes, or the row is automatically quoted, comments doesn't work as expected.

Example:

Take this value as the first cell data of a row.

# Comment lines should have the
first column start with "#" to
avoid parsing error

Because of the usage of newline and quotes, the example cell data above is automatically quoted.
With the config: comments: "#", we would expect this row to be ignored, however, it's still included in the parsed output.

I have tried configuring every possible options and variant of newline and delimeter for both unparse (to create a test csvString data) and parse, but I've hit a dead end.

pokoli commented 7 months ago

Could you please provide a simple sample code to reproduce your issue? This way we can include on our test suite