Added whitespaces to the "collapse consecutive whitespaces" command#4898
Merged
wetneb merged 3 commits intoJun 15, 2022
Merged
Added whitespaces to the "collapse consecutive whitespaces" command#4898wetneb merged 3 commits into
wetneb merged 3 commits into
Conversation
wetneb
reviewed
May 30, 2022
wetneb
left a comment
Member
There was a problem hiding this comment.
Thanks a lot! That looks very good to me. Here are a few ideas for improvement:
- Do we actually need to keep the
\sin the regex? I would suspect those characters are already included in\p{Zs}, no? - We have some functional tests (written in Cypress) and one of them covers this functionality. Perhaps it would be not too hard to adapt this functional test so that the example data includes some interesting Unicode whitespace? You can find the test at
main/tests/cypress/cypress/integration/project/grid/column/edit-cells/common-transforms/collapse-consecutive-whitespace.spec.js
Member
I think we need to keep both as \p{Zs} does not include the tab character (I'm not sure if there are other characters included in \s but not \p{Zs} but the tab character is definitely an issue) |
wetneb
approved these changes
Jun 15, 2022
wetneb
added a commit
that referenced
this pull request
Jun 15, 2022
…ommand (#4898) * fixes#4883 * Add non-breaking spaces to Cypress test data * Update spec for operation notification after change of test data Co-authored-by: Carlos Montano <carlos.montano@192.168.1.4> Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Contributor
Author
|
Hello! |
Member
|
Thanks for checking! I added the test to this pull request already (see https://github.com/OpenRefine/OpenRefine/pull/4898/files) |
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.
fixes #4883
Changes proposed in this pull request:
value.replace(/\\s+/,' ')forvalue.replace(/[\\p{Zs}\\s]+/,' ')