From f8df620a0df4c6bd8f6110067f74a79b3dd5840b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alab=C3=AA=20Duarte?= Date: Tue, 24 Feb 2015 00:36:07 -0300 Subject: #192 - highlights only words that matches with the keywords given --- web-ui/app/js/search/results_highlighter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web-ui/app/js/search') diff --git a/web-ui/app/js/search/results_highlighter.js b/web-ui/app/js/search/results_highlighter.js index 4a4a8eca..9109bca4 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(keyword, 'i'), { + $(domIdent).highlightRegex(new RegExp('\\b' + keyword, 'i'), { tagType: 'em', className: 'search-highlight' }); -- cgit v1.2.3