mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 14:00:29 +00:00
url: allow numeric characters at start
Amends and fixes the last commit which was too simpel. This commit uses a lookbehind to prevent matching $-numeric patterns.
This commit is contained in:
@@ -97,7 +97,7 @@ const rooted_or_relative_path_branch =
|
||||
|
||||
// Branch 3: Bare relative paths such as src/config/url.zig.
|
||||
const bare_relative_path_prefix =
|
||||
\\[A-Za-z_][\w\-.]*\/
|
||||
\\(?<!\$\d*)[\w][\w\-.]*\/
|
||||
;
|
||||
|
||||
const bare_relative_path_branch =
|
||||
@@ -424,6 +424,11 @@ test "url regex" {
|
||||
.input = "foo.local/share",
|
||||
.expect = "foo.local/share",
|
||||
},
|
||||
// numeric directory should match fully
|
||||
.{
|
||||
.input = "2024/report.txt",
|
||||
.expect = "2024/report.txt",
|
||||
},
|
||||
};
|
||||
|
||||
for (cases) |case| {
|
||||
|
||||
Reference in New Issue
Block a user