File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,26 @@ function isZeroWidthCluster(segment) {
3232}
3333
3434function isDoubleWidthEmojiCluster ( segment ) {
35+ const hasVs16 = segment . includes ( '\uFE0F' ) ;
36+
37+ if ( hasVs16 ) {
38+ return true ;
39+ }
40+
3541 const visible = baseVisible ( segment ) ;
3642 const baseScalar = visible . codePointAt ( 0 ) ;
3743 const baseChar = String . fromCodePoint ( baseScalar ) ;
3844 const baseIsEmojiPresentation = emojiPresentationRegex . test ( baseChar ) ;
39- const hasVs16 = segment . includes ( '\uFE0F' ) ;
4045 const hasVs15 = segment . includes ( '\uFE0E' ) ;
46+
47+ if ( baseIsEmojiPresentation && ! hasVs15 ) {
48+ return true ;
49+ }
50+
4151 const codePointCount = [ ...segment ] . length ;
4252 const multiScalarMeaningful = codePointCount > 1 && ! ( codePointCount === 2 && hasVs15 && ! hasVs16 ) ;
4353
44- return hasVs16 || ( baseIsEmojiPresentation && ! hasVs15 ) || multiScalarMeaningful ;
54+ return multiScalarMeaningful ;
4555}
4656
4757function trailingHalfwidthWidth ( segment , eastAsianWidthOptions ) {
You can’t perform that action at this time.
0 commit comments