Repository navigation
Fix finding modifier index start - #110
Conversation
Using `String.prototype.indexOf` is not suitable for adblocker filter list syntax since the regex filter may container the `$` char. This pull request replaces the function call with a regex based search.
- $match-case is only for regex filters - $ as modifiers' sep is invalid
|
Waiting #111 |
|
🚀 Preview deployment is ready! You can view the changes at: https://ghostery.github.io/urlfilter2dnr/preview/pr-110/index.html |
| // @eyeo/webext-ad-filtering-solution is lowercasing the regex metacharacters; | ||
| // the condition below makes the tests pass by lowecasing the full regex from AdGuard | ||
| // refs https://gitlab.com/eyeo/browser-extensions-and-premium/extensions/extensions/-/issues/12 | ||
| .toLowerCase() |
There was a problem hiding this comment.
instead of this, shouldn't we have explicit tests for this behavior ?
There was a problem hiding this comment.
This is not to test but to make the test pass. I just added a test that describes the specific behaviour as well.
|
🚀 Preview deployment is ready! You can view the changes at: https://ghostery.github.io/urlfilter2dnr/preview/pr-110/index.html |
|
🚀 Preview deployment is ready! You can view the changes at: https://ghostery.github.io/urlfilter2dnr/preview/pr-110/index.html |
|
🚀 Preview deployment is ready! You can view the changes at: https://ghostery.github.io/urlfilter2dnr/preview/pr-110/index.html |
# Conflicts: # package-lock.json # package.json
|
🚀 Preview deployment is ready! You can view the changes at: https://ghostery.github.io/urlfilter2dnr/preview/pr-110/index.html |
Using
String.prototype.indexOfis not suitable for adblocker filter list syntax since the regex filter may container the$char. This pull request replaces the function call with a regex based search.