Repository navigation
fix(csv-stringify): preserve field contents when quoting is disabled - #558
Merged
Merged
Conversation
Member
|
I am having second though about this feature. As such, I will revert the changes.
parse(stringify(parse(text, options), options), options).should.eql(parse(text, options))
I am open for an alternative solution :
|
Member
|
@asssslay I just noticed your new PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Disabling quoting can still change field contents. If a delimiter, newline or quoting selector sets
shouldQuote, escape characters are doubled even though the field is surrounded by an empty quote string. This contradicts the documented disabled-quoting behavior and the type declaration's promise to preserve the original field.Reproduces on csv-stringify 6.9.0 and the parent revision, including this delimiter-free case:
Only double escape characters when the normalized quote string is nonempty. This also preserves custom escape characters and quotes supplied by a cast that sets
{ quote: false }for an individual field.All six new regressions fail before the fix and pass afterward. They cover
falseand empty-string quote settings, delimiters and line breaks, quoting selectors, field-level cast options, custom escapes and callback output. Generated distributions were rebuilt and checked, and are left to the release build process.Related to #516, which moves the character checks after formula-prefix insertion while retaining this escape-doubling condition. This change adds the missing disabled-quote guard to that condition.