Skip to content

Commit

Permalink
highlight to the end of word
Browse files Browse the repository at this point in the history
  • Loading branch information
alpancs committed Sep 27, 2024
1 parent cc9d9de commit a186e16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ impl JsQuranize {
let sura_number = self.quranize.get_sura(i).unwrap_or_default();
let aya_number = self.quranize.get_aya(i).unwrap_or_default();
let aya = self.quranize.get_quran(i).unwrap_or_default();
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,
};
let offset = aya
.get(j + quran.len()..)
.and_then(|s| Some(s.split(' ').next()?.len()))
.unwrap_or_default();
let k = j + quran.len() + offset;
JsLocation {
sura_number,
Expand Down

0 comments on commit a186e16

Please sign in to comment.