Permalink
Browse files

fix special chars encoding

  • Loading branch information...
1 parent 3d9af0d commit e665edb97a01b33dde9e68ca137f0778708bfdc5 @nikopol committed Mar 29, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 querytext.js
View
2 querytext.js
@@ -106,7 +106,7 @@ var querytext=(function(o){
var rtrunc = txt.substr(-1) == '*' ? '' : '($|\\W:?)';
//escape special regexp chars
['(',')','+','*','?',':','[',']'].forEach(function(c){
- txt = txt.replace(c,'\c');
+ txt = txt.replace(c,'\\'+c);
});
//concats spaces
txt = txt.replace(/\s+/g,'\\s+');

0 comments on commit e665edb

Please sign in to comment.