Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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.

Copy link
Contributor Author

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.

emoji.push( emojiProperty( cp ) );
}

ans = -1;
for ( i = 1; i <= idx; i++ ) {
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

emoji.push( emojiProperty( cp ) );
}

// Determine if we've encountered a grapheme cluster break...
if ( breakType( breaks, emoji ) > 0 ) {
Expand Down