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

DataTable: Export Function Newline Separator #4001

Closed
EmirBoyaci opened this issue Jan 28, 2023 · 1 comment · Fixed by #4002
Closed

DataTable: Export Function Newline Separator #4001

EmirBoyaci opened this issue Jan 28, 2023 · 1 comment · Fixed by #4002
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@EmirBoyaci
Copy link
Contributor

Describe the feature you would like to see added

Hi,

In the current DataTable if we have a column with newline character (\n) and we want to export that column, it brokes the csv layout. Because, newline character is considered as newline in the exported csv also. To fix that, we can use custom exportFunction and replace \n with it's unicode version \u2028. I think doing that in the source code would make more sense because some people can have problem with that in the future.

Is your feature request related to a problem?

No response

Describe the solution you'd like

No response

Describe alternatives you have considered

No response

Additional context

No response

@EmirBoyaci EmirBoyaci added Status: Discussion Issue or pull request needs to be discussed by Core Team Type: New Feature Issue contains a new feature or new component request labels Jan 28, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 28, 2023
EmirBoyaci added a commit to EmirBoyaci/primereact that referenced this issue Jan 28, 2023
@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Type: New Feature Issue contains a new feature or new component request Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 28, 2023
@melloware melloware added this to the 9.0.0 milestone Jan 28, 2023
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add labels Jan 28, 2023
@melloware
Copy link
Member

I marked this as a BUG as technically this is broken and produces an invalid CSV file.

melloware pushed a commit that referenced this issue Jan 28, 2023
…ing csv (#4002)

* feat: replace newline character with its unicode version while exporting csv

Closes #4001

* feat: replace newline character with its unicode for column header

* chore: chain replace methods

* chore: replace one double quote with two double quotes for column header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants