Commit 4d7952cbd8b31e3ca6b52a6ac0b71e0be90d8231
add word boundries to search, so "search" does not return "research"
Dominic Tarr committed on 6/30/2016, 10:42:19 PMParent: 22804db7d0e820bfb0d4813176775a979a8798f9
Files changed
modules/search.js | changed |
modules/search.js | ||
---|---|---|
@@ -8,9 +8,9 @@ | ||
8 | 8 | var message_render = plugs.first(exports.message_render = []) |
9 | 9 | var sbot_log = plugs.first(exports.sbot_log = []) |
10 | 10 | |
11 | 11 | function searchFilter(query) { |
12 | - var search = new RegExp(query, 'i') | |
12 | + var search = new RegExp('\\b('+query+')\\b', 'i') | |
13 | 13 | return function (msg) { |
14 | 14 | var c = msg && msg.value && msg.value.content |
15 | 15 | return c && ( |
16 | 16 | msg.key == query || |
Built with git-ssb-web