url: fix matching ~, $VAR, .directory/

Related to #1972

This commit adds three new alternatives for
`rooted_or_relative_path_prefix`:

- `~/`
- `$VAR` and
- `.local/`, `.config/` etc. for dot-prefixed directory names
This commit is contained in:
Ben Kircher
2026-02-08 13:41:23 +01:00
parent 72a894b13b
commit d8eb89f384

View File

@@ -75,7 +75,7 @@ const scheme_url_branch =
no_trailing_punctuation;
const rooted_or_relative_path_prefix =
\\(?:\.\.\/|\.\/|(?<!\w)\/)
\\(?:\.\.\/|\.\/|~\/|\$\w+\/|\.[\w][\w\-.]*\/|(?<!\w)\/)
;
// Branch 2: Absolute paths and dot-relative paths (/, ./, ../).