summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/search/results_highlighter.js2
-rw-r--r--web-ui/test/spec/search/results_highlighter.spec.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/web-ui/app/js/search/results_highlighter.js b/web-ui/app/js/search/results_highlighter.js
index 2c7d1cc7..9e3ba167 100644
--- a/web-ui/app/js/search/results_highlighter.js
+++ b/web-ui/app/js/search/results_highlighter.js
@@ -40,7 +40,7 @@ define(
var domIdent = data.where;
if(this.attr.keywords) {
_.each(this.attr.keywords, function (keyword) {
- $(domIdent).highlightRegex(new RegExp('\\b' + keyword, 'i'), {
+ $(domIdent).highlightRegex(new RegExp(keyword, 'i'), {
tagType: 'em',
className: 'search-highlight'
});
diff --git a/web-ui/test/spec/search/results_highlighter.spec.js b/web-ui/test/spec/search/results_highlighter.spec.js
index 523c3599..cfb61e9c 100644
--- a/web-ui/test/spec/search/results_highlighter.spec.js
+++ b/web-ui/test/spec/search/results_highlighter.spec.js
@@ -1,7 +1,7 @@
describeComponent('search/results_highlighter', function () {
'use strict';
- it('highlights only words that matches with the keywords given', function () {
+ it('highlights words or parts of words that match with the keywords given', function () {
this.setupComponent('<div id="text">Any one seeing too many open bugs</div>');
this.component.attr = {keywords: ['any']};
@@ -9,7 +9,7 @@ describeComponent('search/results_highlighter', function () {
var highlightedWords = this.component.$node.find('.search-highlight').length;
- expect(highlightedWords).toEqual(1);
+ expect(highlightedWords).toEqual(2);
});
it('resets highlights when a new search is performed', function() {