We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c8a373 commit 980e0bfCopy full SHA for 980e0bf
index.js
@@ -1,6 +1,6 @@
1
'use strict';
2
var token = '%[a-f0-9]{2}';
3
-var singleMatcher = new RegExp(token, 'gi');
+var singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');
4
var multiMatcher = new RegExp('(' + token + ')+', 'gi');
5
6
function decodeComponents(components, split) {
test.js
@@ -33,9 +33,9 @@ const tests = {
33
'%C2%B5': 'µ',
34
'%C2%B5%': 'µ%',
35
'%%C2%B5%': '%µ%',
36
-
37
- // This should actually return `%ea%baZ%ba`, but fixes a DOS attack for now
38
- '%ea%ba%5a%ba': '꺺'
+ '%ea%ba%5a%ba': '%ea%baZ%ba',
+ '%C3%5A%A5': '%C3Z%A5',
+ '%C3%5A%A5%AB': '%C3Z%A5%AB'
39
};
40
41
function macro(t, input, expected) {
0 commit comments