FiltersCompiler icon indicating copy to clipboard operation
FiltersCompiler copied to clipboard

2 incorrect errors in the compilation process

Open DandelionSprout opened this issue 3 years ago • 3 comments

When looking into https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/ThirdParty/filter_250_DandelionSproutAnnoyances/diff.txt, I've worked out (or at least looked into) various excluded entries, but there are 2 excluded entries that I feel should've been allowed by the compiler, but which aren't:

  1. Regarding Error: "Unknown pseudo class: p:-moz-only-whitespace" in the rule: "##p:-moz-only-whitespace", Mozilla has supported :-moz-only-whitespace for 20 years now, so I at least presume that the Firefox team didn't intend it to be treated as merely a pseudo class. I therefore feel that AdGuard should treat it as a normal class.

  2. Regarding Error: "Unknown modifier: }-\w{10" in the rule: "$removeparam=/^kk=\w{6,}-\w{10,}-\w{5,}$/", I can only presume there's a glitch somewhere in the compiler that makes it think that }-\w{10 was to be looked at as if it was a modifier.

DandelionSprout avatar Jul 03 '22 17:07 DandelionSprout

@DandelionSprout regarding the first one, we do not support custom pseudo-classes for the sake of the proper cross-browser support.

The second one looks like a bug.

ameshkov avatar Jul 03 '22 19:07 ameshkov

the second one is not a bug because special characters like ,, / and $ in the regular expressions should be escaped due to the docs: https://adguardteam.github.io/KnowledgeBase/general/ad-filtering/create-own-filters/#removeparam-modifier

slavaleleka avatar Nov 09 '23 16:11 slavaleleka

The $ marks the end of a text line, and should very likely not be escaped, no matter what the docs say.

The sole use of / is to mark RegEx in the way it has been standardised in adblockers.

And the sole uses of , are in curly number brackets, where commas determine minimum and maximum numbers to repeat the previous character.

DandelionSprout avatar Nov 10 '23 09:11 DandelionSprout