Commit 823185ec authored by Clement Ho's avatar Clement Ho

Fixed bug where search terms with colons were not searchable

parent 339c5d43
...@@ -76,10 +76,13 @@ ...@@ -76,10 +76,13 @@
const inputs = input.split(' '); const inputs = input.split(' ');
let searchTerms = ''; let searchTerms = '';
const addSearchTerm = function addSearchTerm(term) {
searchTerms += term + ' ';
}
inputs.forEach((i) => { inputs.forEach((i) => {
const colonIndex = i.indexOf(':'); const colonIndex = i.indexOf(':');
// Check if text is a token
if (colonIndex !== -1) { if (colonIndex !== -1) {
const tokenKey = i.slice(0, colonIndex).toLowerCase(); const tokenKey = i.slice(0, colonIndex).toLowerCase();
const tokenValue = i.slice(colonIndex + 1); const tokenValue = i.slice(colonIndex + 1);
...@@ -93,9 +96,11 @@ ...@@ -93,9 +96,11 @@
key: match.key, key: match.key,
value: tokenValue, value: tokenValue,
}); });
} else {
addSearchTerm(i);
} }
} else { } else {
searchTerms += i + ' '; addSearchTerm(i);
} }
}, this); }, this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment