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 @@
const inputs = input.split(' ');
let searchTerms = '';
const addSearchTerm = function addSearchTerm(term) {
searchTerms += term + ' ';
}
inputs.forEach((i) => {
const colonIndex = i.indexOf(':');
// Check if text is a token
if (colonIndex !== -1) {
const tokenKey = i.slice(0, colonIndex).toLowerCase();
const tokenValue = i.slice(colonIndex + 1);
......@@ -93,9 +96,11 @@
key: match.key,
value: tokenValue,
});
} else {
addSearchTerm(i);
}
} else {
searchTerms += i + ' ';
addSearchTerm(i);
}
}, 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