Skip to content

Commit

Permalink
offset bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alpancs committed Sep 24, 2024
1 parent a054b35 commit 1e185db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl JsQuranize {
{ self.quranize.find(quran).into_iter() }
.map(|(i, j)| {
let (s, a, aya) = self.quranize.get_sura_aya_quran(i).unwrap_or_default();
let offset = match aya[j..].chars().next() {
let offset = match aya.get(j + quran.len()..).and_then(|s| s.chars().next()) {
Some(c @ ('\u{064B}'..'\u{0651}' | '\u{0670}')) => c.len_utf8(),
_ => 0,
};
Expand Down

0 comments on commit 1e185db

Please sign in to comment.