Improve TSV serialization when copying cells #2867
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2811
Notes
This PR adds the PapaParse library and uses it to serialize cell data to a TSV string when copying cells to the clipboard.
Before/after
Set up four cells with the following content. Then copy them and inspect your clipboard
banana, orange
potato"
carrot
(with the ⏩ emoji representing a tab character)
Before
The clipboard contents are:
Pasting into LibreOffice Calc or Google Sheets leads to mangled data.
After
The clipboard contents are:
Pasting into LibreOffice Calc and Google Sheets works as expected.
Bundle size increase
Choice of library
Key
The one I chose
papaparse
Alternatives worth considering
csv
json-2-csv
Tried and didn't like
csv-string
Others I looked at
csv-parser
comma-separated-values
d3-dsv
| GHcsvtojson
neat-csv
csv-parser
tsv
zsv-lib
Checklist
Update index.md
).develop
branch of the repositoryDeveloper Certificate of Origin
Developer Certificate of Origin