-
Notifications
You must be signed in to change notification settings - Fork 155
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
Delete trailing new line character from pasted text #140
base: master
Are you sure you want to change the base?
Delete trailing new line character from pasted text #140
Conversation
src/matrix.ts
Outdated
@@ -154,9 +154,10 @@ export function split<T>( | |||
csv: string, | |||
transform: (value: string) => T, | |||
horizontalSeparator = "\t", | |||
verticalSeparator: string | RegExp = /\r\n|\n|\r/ | |||
verticalSeparator = /\r\n|\n|\r/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not remove the ability to accept a string here
src/matrix.ts
Outdated
): Matrix<T> { | ||
return csv | ||
.replace(new RegExp('(' + verticalSeparator.source + ')$'), '') // delete trailing new line character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please support getting a string here
@nullnull can you please fix my comments so I can merge your PR? |
@iddan Sorry for late reply. I've fixed it! |
a5442a2
to
3c0c51e
Compare
Problem
When copying single empty cell from Google Spreadsheet (or copy some values from Excel), pasting result includes extra empty row.
Cause
Because copied value from Google Spreadsheet's empty cell is "\n".
Solution
I think it's better to delete trailing new line character from pasted text.