-
-
Notifications
You must be signed in to change notification settings - Fork 447
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
fix: resolve issue with prev-grapheme-cluster-break function #1431
base: develop
Are you sure you want to change the base?
Conversation
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.
👋 Hi there! 👋
And thank you for opening your first pull request! We will review it shortly. 🏃 💨
@kgryte , @Pranavchiku, @Planeshifter Please check the integrity of this PR, and send reviews |
@@ -99,7 +99,9 @@ function prevGraphemeClusterBreak( str, fromIndex ) { | |||
|
|||
// Get the corresponding grapheme break and emoji properties: | |||
breaks.push( breakProperty( cp ) ); | |||
emoji.push( emojiProperty( cp ) ); | |||
if (!(cp >= 0x1F3FB && cp <= 0x1F3FF)) { // Check if the character is not a skin tone modifier |
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.
This is too narrow a patch. It is not just skin tones, TMK, but any modifier. The implementation more generally should be refactored to ensure that grapheme clusters comprised of multiple code points are handled correctly.
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.
Oh I am sorry, I got confused by seeing the original issue being raised about the colour tone.
I will try to debug and propose a generic solution to this as soon as possible.
Thank You.
@@ -114,7 +116,9 @@ function prevGraphemeClusterBreak( str, fromIndex ) { | |||
|
|||
// Get the corresponding grapheme break and emoji properties: | |||
breaks.push( breakProperty( cp ) ); | |||
emoji.push( emojiProperty( cp ) ); | |||
if (!(cp >= 0x1F3FB && cp <= 0x1F3FF)) { // Check if the character is not a skin tone modifier |
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.
Same comment as above.
Resolves #1092 .
Description
There's an issue with prevGraphemeClusterBreak package, if I compare the results with nextGraphemeClusterBreak for a single skin tone emoji it doesn't return the same values,
Related Issues
This pull request:
prevGraphemeClusterBreak
package #1092Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers