Skip to content

Conversation

clodal
Copy link

@clodal clodal commented Jun 1, 2018

Related to #28

  • Enables react-csv to export html content e.g. '<h1 style="text-align:center;">example</h1>' by escaping double quotes as set out in rfc4180.

Look forward to your feedback. Thank you!

@coveralls
Copy link

coveralls commented Jun 1, 2018

Coverage Status

Coverage increased (+1.0%) to 95.789% when pulling 6e42eaa on clodal:escape-quote-marks into e7cdb55 on abdennour:master.

@verychgliu
Copy link

This PR would be useful for my current project.

@mccabemj
Copy link
Collaborator

@clodal can you fix the conflicting files so I can review for merge?

@dasniko
Copy link

dasniko commented Oct 31, 2018

I'd love to see this indeed very useful feature in react-csv, too.

Currently I do some character conversion/masking when collecting the data, but the cleaner solution would be to have this feature included in this lib.

@mriccid
Copy link
Collaborator

mriccid commented Oct 31, 2018

I'd prefer to modify elementOrEmpty to handle the escaping, as currently every cell's value goes through that function. It would be a smaller and simpler change.

@clodal clodal force-pushed the escape-quote-marks branch from 07e45d1 to 6e42eaa Compare November 3, 2018 03:59
@clodal
Copy link
Author

clodal commented Nov 3, 2018

@mriccid Thanks for the tip, works great!
@mccabemj Done, thank you

@mriccid mriccid force-pushed the master branch 2 times, most recently from 4c691cb to f129262 Compare February 5, 2019 05:12
@mccabemj
Copy link
Collaborator

mccabemj commented Feb 5, 2019

Do we think this is still needed with PR #74 in? If the prop enclosingCharacter was selected as a single quote, this would negate the need for it to be escaped (as per rfc4180)

If double-quotes are used to enclose fields, then a double-quote
appearing inside a field must be escaped by preceding it with
another double quote

Shall we conditionally look at the passed in enclosingCharacter or escape regardless? Thoughts @abdennour @mriccid @clodal ?

@leapwill
Copy link

I vote for conditionally look at the enclosingCharacter

@clodal clodal closed this Nov 4, 2021
@clodal
Copy link
Author

clodal commented Nov 4, 2021

Alright, closing PR then! Thanks

@abdennour
Copy link
Collaborator

Released with react-csv@2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants