From b9bd141b24c86a3df7d909f20cae34bee4dba8dc Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 25 May 2020 15:55:07 +0200 Subject: [PATCH] Fix tag search issues --- www/common/userObject.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/www/common/userObject.js b/www/common/userObject.js index b11bcf4b1..fbe28864a 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -644,14 +644,9 @@ define([ // parse the search string into tags var tags; - lValue.replace(/^#(.*)/, function (all, t) { - tags = t.split(/\s+/) - .map(function (tag) { - return tag.replace(/^#/, ''); - }).filter(function (x) { - return x; - }); - }); + if (/^#/.test(lValue)) { + tags = [lValue.slice(1).trim()]; + } /* returns true if an entry's tags are at least a partial match for one of the specified tags */ @@ -661,7 +656,7 @@ define([ T = T.map(function (t) { return t.toLowerCase(); }); return tags.some(function (tag) { return T.some(function (t) { - return t.indexOf(tag) !== -1; + return t === tag; }); }); };