| Index: lib/filterClasses.js |
| =================================================================== |
| --- a/lib/filterClasses.js |
| +++ b/lib/filterClasses.js |
| @@ -183,17 +183,17 @@ |
| // Don't remove spaces inside comments |
| if (/^ *!/.test(text)) |
| return text.trim(); |
| // Special treatment for element hiding filters, right side is allowed to |
| // contain spaces |
| if (Filter.elemhideRegExp.test(text)) |
| { |
| - let [, domain, separator, selector] = /^(.*?)(#@?#?)(.*)$/.exec(text); |
| + let [, domain, separator, selector] = /^(.*?)(#[@?]?#?)(.*)$/.exec(text); |
|
Manish Jethani
2018/04/08 09:40:09
It seems we forgot to include the "#?#" case here.
kzar
2018/04/09 10:38:29
Shouldn't the question mark be escaped?
hub
2018/04/09 15:02:07
In between the [], it doesn't need to. It is taken
kzar
2018/04/09 15:29:46
Acknowledged.
|
| return domain.replace(/ +/g, "") + separator + selector.trim(); |
| } |
| // For most regexp filters we strip all spaces, but $csp filter options |
| // are allowed to contain single (non trailing) spaces. |
| let strippedText = text.replace(/ +/g, ""); |
| if (!strippedText.includes("$") || !/\bcsp=/i.test(strippedText)) |
| return strippedText; |