| Index: lib/filterClasses.js |
| =================================================================== |
| --- a/lib/filterClasses.js |
| +++ b/lib/filterClasses.js |
| @@ -757,31 +757,25 @@ |
| let contentType = null; |
| let matchCase = null; |
| let domains = null; |
| let sitekeys = null; |
| let thirdParty = null; |
| let collapse = null; |
| let csp = null; |
| let rewrite = null; |
| - let options; |
| + |
| let match = text.includes("$") ? Filter.optionsRegExp.exec(text) : null; |
| if (match) |
| { |
| - options = match[1].split(","); |
| text = match.input.substr(0, match.index); |
| - for (let option of options) |
| + |
| + for (let re = /([^,=]+)(?:=([^,]*))?/g, m; m = re.exec(match[1]);) |
| { |
| - let value = null; |
| - let separatorIndex = option.indexOf("="); |
| - if (separatorIndex >= 0) |
| - { |
| - value = option.substr(separatorIndex + 1); |
| - option = option.substr(0, separatorIndex); |
| - } |
| + let [, option, value] = m; |
| let inverse = option[0] == "~"; |
| if (inverse) |
| option = option.substr(1); |
| let type = RegExpFilter.typeMap[option.replace(/-/, "_").toUpperCase()]; |
| if (type) |
| { |