Skip to content

Commit d1e3c42

Browse files
committed
Can now strip also numbers victorjonsson#488
1 parent 244f952 commit d1e3c42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/sanitize.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
strip: function(val, $input) {
8585
var toRemove = $input.attr('data-sanitize-strip') || '';
8686
$.split(toRemove, function(char) {
87-
val = val.replace(new RegExp('\\'+char, 'g'), '');
87+
var regex = new RegExp($.isNumeric(char) ? char : '\\'+char, 'g');
88+
val = val.replace(regex, '');
8889
});
8990
return val;
9091
},

0 commit comments

Comments
 (0)