git ssb

0+

dangerousbeans / patchbay-bootstrap



Commit 4d7952cbd8b31e3ca6b52a6ac0b71e0be90d8231

add word boundries to search, so "search" does not return "research"

Dominic Tarr committed on 6/30/2016, 10:42:19 PM
Parent: 22804db7d0e820bfb0d4813176775a979a8798f9

Files changed

modules/search.jschanged
modules/search.jsView
@@ -8,9 +8,9 @@
88 var message_render = plugs.first(exports.message_render = [])
99 var sbot_log = plugs.first(exports.sbot_log = [])
1010
1111 function searchFilter(query) {
12- var search = new RegExp(query, 'i')
12+ var search = new RegExp('\\b('+query+')\\b', 'i')
1313 return function (msg) {
1414 var c = msg && msg.value && msg.value.content
1515 return c && (
1616 msg.key == query ||

Built with git-ssb-web