He there! In my installation of Discourse 2.5.0.beta1 there is not working highlighting searched keywords in search results if search was done in other than english.
Is it a bug or a feature?)
Thanks
What is expected here @sam?
We only highlight complete words. This looks like a partial word.
@vinothkannans can you have a quick look at:
@smith can you make a post here with the exact Greek word? (I think this is Greek) this could be a bug in our highlighting Javascript library.
This is Cyrillic, based on Greek tho, here is some example:
Ибо угодно Святому Духу и нам не возлагать на вас никакого бремени более, кроме сего необходимого:
воздерживаться от идоложертвенного и крови, и удавленины, и блуда, и не делать другим того, чего себе не хотите. Соблюдая сие, хорошо сделаете. Будьте здравы.
The issue is in the jQuery Highlight plugin. To highlight the words it’s using the word boundary \b
regex which is not supported in Unicode characters.
(?<=[\s,.:;"']|^)UNICODE_WORD(?=[\s,.:;"']|$)
It looks like a possible solution
I think @gerhard dealt with this particular issue with unicode usernames (at least I vaguely recall)
Super happy to see a fix here, but we got to be ultra careful that whatever regex we choose does not have pathologically bad performance in certain cases where text is long or particularly bad. Also I think in Chinese we don’t even care about word boundaries?
Created a new PR with the fix
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.