From c8d5b2da454cc1926b4369d9719081d6f3b1b683 Mon Sep 17 00:00:00 2001 From: Bryan Lee <38807139+liby@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:14:51 +0800 Subject: [PATCH] Add IPv6 URL pattern support with comprehensive test cases - Add IPv6 URL pattern matching to support URLs like http://[::]:8000/ - Separate IPv6 URL pattern from main regex for better maintainability - Add extensive test cases covering: - Basic IPv6 URLs with ports - URLs with paths and query parameters - Compressed IPv6 forms - Link-local and multicast addresses - Mixed scenarios and markdown contexts --- src/config/url.zig | 57 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/src/config/url.zig b/src/config/url.zig index f5709a3833..78f9816fdb 100644 --- a/src/config/url.zig +++ b/src/config/url.zig @@ -24,12 +24,18 @@ const oni = @import("oniguruma"); /// handling them well requires a non-regex approach. pub const regex = "(?:" ++ url_schemes ++ - \\)(?:[\w\-.~:/?#@!$&*+,;=%]+(?:[\(\[]\w*[\)\]])?)+(?