Closed bogas04 closed 6 years ago
This is kinda tricky thing to do.
We can only color if we use spans. And when we use spans, larivaar gets bit complicated. And then we're changing larivaar implementation heavily. I'm bit confused.
And then there's unicode, and other cases like romanized/words.
Also, the logic to find substring as of now is this;
const highlightStartIndex = shabad.gurbani.gurmukhi
// split all words
.split(' ')
// get initials only
.map(e => e[0])
// join them in a string
.join('')
// get index of the query in this string
.indexOf(q);
const higlightEndIndex = highlightStartIndex + q.length;
This works for first letter searches, but i've to add logic for other cases.
@ManjotS the color choice has to be changed too coz larivaarAssist uses that color.
(mmgg)
Okay i've supported unicode as well as all other search types (except translation/ang).
Larivaar would be bit complicated and maybe we can release for it later.
@tarunsingh5 @ManjotS @saintsoldierx please give your feedback. If all looks good i can merge it to dev for testing.
Romanized | Full Word Gurmukhi | First Letter | First Letter (Dark) |
---|---|---|---|
Also @ManjotS, I'm in love with Romanized Search. So accurate.
What about bisram
On Sat, Jun 16, 2018, 7:14 AM Divjot Singh notifications@github.com wrote:
Closed #476 https://github.com/KhalisFoundation/sttm-web/issues/476 via 0e2ef5b https://github.com/KhalisFoundation/sttm-web/commit/0e2ef5b981bb0548ce1fb8f9f596388713c445a1 .
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/KhalisFoundation/sttm-web/issues/476#event-1684634024, or mute the thread https://github.com/notifications/unsubscribe-auth/AAnXFYk6uH0ezfFcPbodDsF9jk_FV0Dcks5t9PaZgaJpZM4UO0E1 .
@ManjotS bisraam for shabad view, query highlight for search results?
Bisram on should apply everywhere @bogas04