Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -147,13 +147,13 @@ |
if (/^\s*!/.test(text)) |
{ |
// Don't remove spaces inside comments |
- return text.replace(/^\s+/, "").replace(/\s+$/, ""); |
+ return text.trim(); |
} |
else if (Filter.elemhideRegExp.test(text)) |
{ |
// Special treatment for element hiding filters, right side is allowed to contain spaces |
let [, domain, separator, selector] = /^(.*?)(#\@?#?)(.*)$/.exec(text); |
- return domain.replace(/\s/g, "") + separator + selector.replace(/^\s+/, "").replace(/\s+$/, ""); |
+ return domain.replace(/\s/g, "") + separator + selector.trim(); |
} |
else |
return text.replace(/\s/g, ""); |