@@ -1220,10 +1220,12 @@ $(document).ready(function() {
1220
1220
// Remove existing annotation
1221
1221
$ ( '#tokensregex' ) . remove ( ) ;
1222
1222
// Make ajax call
1223
+ // Previously this would escape the + and & in pattern before the
1224
+ // call to encodeURIComponent, but the server doesn't double
1225
+ // unescape the incoming patterns, so that was not working
1223
1226
$ . ajax ( {
1224
1227
type : 'POST' ,
1225
- url : serverAddress + '/tokensregex?pattern=' + encodeURIComponent (
1226
- pattern . replace ( "&" , "\\&" ) . replace ( '+' , '\\+' ) ) +
1228
+ url : serverAddress + '/tokensregex?pattern=' + encodeURIComponent ( pattern ) +
1227
1229
'&properties=' + encodeURIComponent (
1228
1230
'{"annotators": "' + annotators ( ) + '", "date": "' + date ( ) + '"}' ) +
1229
1231
'&pipelineLanguage=' + encodeURIComponent ( $ ( '#language' ) . val ( ) ) ,
@@ -1263,8 +1265,7 @@ $(document).ready(function() {
1263
1265
// Make ajax call
1264
1266
$ . ajax ( {
1265
1267
type : 'POST' ,
1266
- url : serverAddress + '/semgrex?pattern=' + encodeURIComponent (
1267
- pattern . replace ( "&" , "\\&" ) . replace ( '+' , '\\+' ) ) +
1268
+ url : serverAddress + '/semgrex?pattern=' + encodeURIComponent ( pattern ) +
1268
1269
'&properties=' + encodeURIComponent (
1269
1270
'{"annotators": "' + requiredAnnotators . join ( ',' ) + '", "date": "' + date ( ) + '"}' ) +
1270
1271
'&pipelineLanguage=' + encodeURIComponent ( $ ( '#language' ) . val ( ) ) ,
@@ -1303,8 +1304,7 @@ $(document).ready(function() {
1303
1304
// Make ajax call
1304
1305
$ . ajax ( {
1305
1306
type : 'POST' ,
1306
- url : serverAddress + '/tregex?pattern=' + encodeURIComponent (
1307
- pattern . replace ( "&" , "\\&" ) . replace ( '+' , '\\+' ) ) +
1307
+ url : serverAddress + '/tregex?pattern=' + encodeURIComponent ( pattern ) +
1308
1308
'&properties=' + encodeURIComponent (
1309
1309
'{"annotators": "' + requiredAnnotators . join ( ',' ) + '", "date": "' + date ( ) + '"}' ) +
1310
1310
'&pipelineLanguage=' + encodeURIComponent ( $ ( '#language' ) . val ( ) ) ,
0 commit comments