Skip to content

Commit 137f34b

Browse files
committed
Fix state of reverse iterator after ZWJ
Fixes #14.
1 parent ac92979 commit 137f34b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/grapheme.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ impl<'a> DoubleEndedIterator for Graphemes<'a> {
344344
take_curr = false;
345345
break;
346346
},
347-
Zwj => match cat { // char to right is (GAZ|EBG)
348-
gr::GC_ZWJ => continue, // rule GB11: ZWJ x (GAZ|EBG)
347+
Zwj => match cat { // char to right is (GAZ|EBG)
348+
gr::GC_ZWJ => FindExtend, // rule GB11: ZWJ x (GAZ|EBG)
349349
_ => {
350350
take_curr = false;
351351
break;

src/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ fn test_graphemes() {
3232

3333
pub const EXTRA_SAME: &'static [(&'static str, &'static [&'static str])] = &[
3434
// family emoji (more than two emoji joined by ZWJ)
35-
("\u{1f681}\u{1f6a6}\u{1f468}\u{200d}\u{1f467}\u{200d}\u{1f466}\u{1f469}\u{200d}\u{1f467}\u{200d}\u{1f466}",
36-
&[]),
35+
("\u{1f468}\u{200d}\u{1f467}\u{200d}\u{1f466}",
36+
&["\u{1f468}\u{200d}\u{1f467}\u{200d}\u{1f466}"]),
3737
];
3838

3939
for &(s, g) in TEST_SAME.iter().chain(EXTRA_SAME) {

0 commit comments

Comments
 (0)