mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-09 12:51:45 -04:00
Regex: share the PCRE2 wrapper beyond adblock
Compiled patterns are useful anywhere someone else writes the pattern: the adblock lists today, agent tool arguments next. The wrapper moves out of the adblock directory and gains an options struct (case, UTF-8 subjects) and a compile diagnostic the caller can log or show. The App owns the one context every consumer compiles through, the blocker included.
This commit is contained in:
1 parent
b3c327970f
commit
d2f72a9fa9
7 files changed
+141
-67
No files matched your search
@@ -4427,7 +4427,7 @@ test "HttpClient: adblock verdicts apply per request" {
|
||||
var client: Client = undefined;
|
||||
initTestClient(&client, &pool);
|
||||
|
||||
var blocker: AdBlocker = try .init(testing.allocator);
|
||||
var blocker: AdBlocker = try .init(testing.allocator, testing.test_app.regex_context);
|
||||
defer blocker.deinit();
|
||||
var list: std.Io.Reader = .fixed(
|
||||
\\||ads.example.com^
|
||||
|
||||
Reference in new issue
Block a user