Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve new lines in cells with option preserveNewLinesInCells (#91) #171

Merged
merged 2 commits into from
May 8, 2017

Conversation

glutentag
Copy link
Contributor

\n and \r are converted to \u2028 and \u2029 in order to pass through
JSON.stringify, then converted back to \n and \r.
Note any original \u2028 and \u2029 are converted to \n and \r.

…rco#91)

\n and \r are converted to \u2028 and \u2029 in order to pass through
JSON.stringify, then converted back to \n and \r.
Note any original \u2028 and \u2029 are converted to \n and \r.
@coveralls
Copy link

coveralls commented Apr 25, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling dd344c5 on glutentag:preserve_new_lines into 1102a50 on zemirco:master.

@glutentag
Copy link
Contributor Author

My attempt to fix #91. I preferred to use an option to prevent any side effect with Excel users, but it worked for me with Excel on Windows and OSX.

Copy link
Collaborator

@knownasilya knownasilya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple minor tweaks.

README.md Outdated
@@ -46,6 +46,7 @@ try {
- Supports optional custom quotation marks
- Not create CSV column title by passing hasCSVColumnTitle: false, into params.
- If field is not exist in object then the field value in CSV will be empty.
- Preserve new lines in cells. Should be used we \r\n line ending for full compatibility with Excel.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, "should be used with"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"line endings"

README.md Outdated
@@ -67,6 +68,7 @@ try {
- `unwindPath` - String, creates multiple rows from a single JSON document similar to MongoDB's $unwind
- `excelStrings` - Boolean, converts string data into normalized Excel style data.
- `includeEmptyRows` - Boolean, includes empty rows. Defaults to `false`.
- `preserveNewLinesInCells` - Boolean, preserve \r and \n in cells. Defaults to `false`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cells are Excell specific, let's call this something more generic.

@knownasilya
Copy link
Collaborator

I'm not sure if this should even be an option. Maybe it should be on by default.

@coveralls
Copy link

coveralls commented Apr 26, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 399611b on glutentag:preserve_new_lines into 1102a50 on zemirco:master.

@glutentag
Copy link
Contributor Author

Thanks for the review. I used the term 'value' instead of 'cell', is it fine for you?
I agree this could be a default option, but from the comments in #114 I preferred to prevent any potential breaking change.

@knownasilya knownasilya merged commit 187b701 into zemirco:master May 8, 2017
@nawlbergs nawlbergs mentioned this pull request May 4, 2020
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.

3 participants