Skip to content

Commit

Permalink
Fix #279 -- code for word passage mode was missing a case where grade…
Browse files Browse the repository at this point in the history
… 1 occurs, which should end cap word mode.

Added test for the bug.
  • Loading branch information
NSoiffer committed Sep 10, 2024
1 parent 58181e2 commit 31d0f90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/braille.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,8 @@ fn ueb_cleanup(pref_manager: Ref<PreferenceManager>, raw_braille: String) -> Str
assert!(cap_mode == UEB_Duration::Word);
}
is_cap_mode = false;
} else if ch == '1' && is_cap_mode {
break;
}
}
return n_caps > 4;
Expand Down
6 changes: 6 additions & 0 deletions tests/braille/UEB/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,9 @@ fn contractions_5() {
let expr = "<math><mi>Real</mi><mo>(</mo><mi>z</mi><mo>)</mo></math>";
test_braille("UEB", expr, "⠠⠗⠂⠇⠐⠣⠵⠐⠜");
}

#[test]
fn caps_bug_279() {
let expr = "<math><mfrac><mrow><mi>A</mi><mi>B</mi></mrow><mi>B</mi></mfrac></math>";
test_braille("UEB", expr, "⠰⠰⠷⠠⠠⠁⠃⠨⠌⠠⠃⠾");
}

0 comments on commit 31d0f90

Please sign in to comment.