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.
For it has seemed good to the Holy Spirit and to us to lay on you no greater burden than these necessary things: to abstain from things offered to idols, from blood, from things strangled, and from sexual immorality. If you keep yourselves from these, you will do well. Farewell.
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.
https://medium.com/@shiba1014/regex-word-boundaries-with-unicode-207794f6e7ed
(?<=[\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.


