| Index: lib/abp2blocklist.js |
| =================================================================== |
| --- a/lib/abp2blocklist.js |
| +++ b/lib/abp2blocklist.js |
| @@ -143,18 +143,23 @@ |
| switch (c) |
| { |
| case "*": |
| if (regexp.length > 0 && i < lastIndex && text[i + 1] != "*") |
| regexp.push(".*"); |
| break; |
| case "^": |
| - if (i < lastIndex) |
| - regexp.push("."); |
| + let separator = "[^-_.%" + (justHostname ? "" : "A-Z") + "a-z0-9]"; |
|
kzar
2017/07/07 12:46:18
I don't understand the logic with justHostname her
kzar
2017/07/07 12:46:18
Like I mentioned in the issue shouldn't the period
Manish Jethani
2017/07/08 06:29:10
For filters like "example.co^" and "example.co^*^h
Manish Jethani
2017/07/08 06:29:10
I replied there as well. No, the period must not b
kzar
2017/07/10 12:39:56
Ah OK, thanks. Would you mind adding a comment to
kzar
2017/07/10 12:39:56
Acknowledged.
Manish Jethani
2017/07/11 17:10:33
Done.
I've also made the code a bit more verbose
kzar
2017/07/12 09:16:31
Thanks, while a little verbose like you mention I
|
| + if (i == 0) |
|
Manish Jethani
2017/06/19 10:39:54
Support separators at the beginning of the filter
kzar
2017/07/07 12:46:18
Acknowledged.
|
| + regexp.push("^https?://(.*" + separator + ")?"); |
| + else if (i == lastIndex) |
| + regexp.push("(" + separator + ".*)?$"); |
| + else |
| + regexp.push(separator); |
| break; |
| case "|": |
| if (i == 0) |
| { |
| regexp.push("^"); |
| break; |
| } |
| if (i == lastIndex) |