File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 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> {
375375
376376 if cat == wd:: WC_Extend || cat == wd:: WC_Format || cat == wd:: WC_ZWJ {
377377 if match state {
378+ Zwj ( _) if cat == wd:: WC_ZWJ => false ,
378379 FormatExtend ( _) | Start => false ,
379380 _ => true
380381 } {
@@ -489,8 +490,6 @@ impl<'a> DoubleEndedIterator for UWordBounds<'a> {
489490 let count = self . string [ ..previdx]
490491 . chars ( ) . rev ( )
491492 . map ( |c| wd:: word_category ( c) )
492- // Ignore because of WB4
493- // Combining characters *inside* flag emoji. Yay.
494493 . filter ( |& c| ! ( c == wd:: WC_ZWJ || c == wd:: WC_Extend || c == wd:: WC_Format ) )
495494 . take_while ( |& c| c == wd:: WC_Regional_Indicator )
496495 . count ( ) ;
@@ -513,7 +512,10 @@ impl<'a> DoubleEndedIterator for UWordBounds<'a> {
513512 }
514513 } ,
515514 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+ } ,
517519 _ => {
518520 take_curr = false ;
519521 break ;
You can’t perform that action at this time.
0 commit comments