File tree 1 file changed +5
-3
lines changed 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ impl<'a> DoubleEndedIterator for UWordBounds<'a> {
375
375
376
376
if cat == wd:: WC_Extend || cat == wd:: WC_Format || cat == wd:: WC_ZWJ {
377
377
if match state {
378
+ Zwj ( _) if cat == wd:: WC_ZWJ => false ,
378
379
FormatExtend ( _) | Start => false ,
379
380
_ => true
380
381
} {
@@ -489,8 +490,6 @@ impl<'a> DoubleEndedIterator for UWordBounds<'a> {
489
490
let count = self . string [ ..previdx]
490
491
. chars ( ) . rev ( )
491
492
. map ( |c| wd:: word_category ( c) )
492
- // Ignore because of WB4
493
- // Combining characters *inside* flag emoji. Yay.
494
493
. filter ( |& c| ! ( c == wd:: WC_ZWJ || c == wd:: WC_Extend || c == wd:: WC_Format ) )
495
494
. take_while ( |& c| c == wd:: WC_Regional_Indicator )
496
495
. count ( ) ;
@@ -513,7 +512,10 @@ impl<'a> DoubleEndedIterator for UWordBounds<'a> {
513
512
}
514
513
} ,
515
514
Emoji => match cat { // rule WB14
516
- wd:: WC_E_Base | wd:: WC_E_Base_GAZ => continue ,
515
+ wd:: WC_E_Base | wd:: WC_E_Base_GAZ => {
516
+ state = Zwj ( false ) ;
517
+ continue
518
+ } ,
517
519
_ => {
518
520
take_curr = false ;
519
521
break ;
You can’t perform that action at this time.
0 commit comments