client/search: escape : in tag search

This commit is contained in:
rr-
2016-09-29 22:45:40 +02:00
parent 7648f479a9
commit 977cc47966
4 changed files with 52 additions and 26 deletions

View File

@ -213,6 +213,10 @@ function arraysDiffer(source1, source2, orderImportant) {
source2.filter(value => !source1.includes(value)).length > 0);
}
function escapeSearchTerm(text) {
return text.replace(/([a-z_-]):/g, '$1\\:');
}
module.exports = {
range: range,
formatUrlParameters: formatUrlParameters,
@ -231,4 +235,5 @@ module.exports = {
splitByWhitespace: splitByWhitespace,
arraysDiffer: arraysDiffer,
decamelize: decamelize,
escapeSearchTerm: escapeSearchTerm,
};