You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-15 11:01:52 +03:00
Fix sorting of search result highlights
Make sure that we *actually* give preference to longer search result highlights; it turns out that the code that looked like it was doing so has never worked.
This commit is contained in:
@ -553,7 +553,8 @@ module.exports = React.createClass({
|
||||
|
||||
// For overlapping highlights,
|
||||
// favour longer (more specific) terms first
|
||||
highlights = highlights.sort(function(a, b) { b.length - a.length });
|
||||
highlights = highlights.sort(function(a, b) {
|
||||
return b.length - a.length });
|
||||
|
||||
self.setState({
|
||||
searchHighlights: highlights,
|
||||
|
Reference in New Issue
Block a user