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.
pull/21833/head
Richard van der Hoff 2016-01-08 13:25:03 +00:00
parent 8170288acb
commit 223f6f7914
1 changed files with 2 additions and 1 deletions

View File

@ -553,7 +553,8 @@ module.exports = React.createClass({
// For overlapping highlights, // For overlapping highlights,
// favour longer (more specific) terms first // 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({ self.setState({
searchHighlights: highlights, searchHighlights: highlights,