diff --git a/src/config/url.zig b/src/config/url.zig index 5eb6e26f2..fa902210f 100644 --- a/src/config/url.zig +++ b/src/config/url.zig @@ -61,11 +61,11 @@ const non_dotted_path_lookahead = ; const dotted_path_space_segments = - \\(?: [\w\-.~:\/?#@!$&*+;=%]*[\/.])* + \\(?: (?!\w+:\/\/)[\w\-.~:\/?#@!$&*+;=%]*[\/.])* ; const any_path_space_segments = - \\(?: [\w\-.~:\/?#@!$&*+;=%]+)* + \\(?: (?!\w+:\/\/)[\w\-.~:\/?#@!$&*+;=%]+)* ; // Branch 1: URLs with explicit schemes (http, mailto, ftp, etc.). @@ -226,6 +226,10 @@ test "url regex" { .input = "match git://example.com git links", .expect = "git://example.com", }, + .{ + .input = "/tmp/test.txt http://www.google.com", + .expect = "/tmp/test.txt", + }, .{ .input = "match tel:+18005551234 tel links", .expect = "tel:+18005551234",