15 Commits

Author SHA1 Message Date
Weizhao Ouyang
528814da79 url: restrict file paths regex to one slash
This restricts the valid path prefixes to prevent false matches caused
by literal dot.

Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
2025-05-14 23:20:09 +08:00
Mitchell Hashimoto
4d0bf303c6 ci: zig fmt check
This adds a CI test to ensure that all Zig files are properly formatted.
This avoids unrelated diff noise in future PRs.
2025-03-18 13:58:49 -07:00
Bryan Lee
c8d5b2da45 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
2025-01-07 14:54:16 +08:00
Mustaque Ahmed
85743aebd5 feat: add support for file paths starts with ../ ./ and /
To implement this I extended the existing regex variable in the `src/config` dir. In a few test cases, extra space is added intentionally to verify we don't include space in the URL as it looks & feels odd.
2025-01-07 01:13:29 +05:30
Vincent Prigent
96bda270a2 Add two edge cases to the url regex 2024-11-22 22:57:45 +13:00
Erlend Lind Madsen
e3881c4ffc avoid escape characters by using a multiline string
lets concat url_scheme in combo with a multiline (thanks @qwerasd205)

regex: url_scheme -> url_schemes
2024-08-28 23:13:13 +02:00
Łukasz Niemier
f9be02a20f chore: clean up typos 2024-08-05 13:56:57 +02:00
Erlend Lind Madsen
c418ae577c url: add missing rarer (all) characters allowed in URL 2024-02-02 04:59:13 +01:00
Erlend Lind Madsen
823aedbb88 url: add missing url-scheme tests 2024-02-02 03:17:24 +01:00
Erlend Lind Madsen
a3e2d9d250 url: sort url schemes by most-used 2024-02-02 02:59:55 +01:00
Erlend Lind Madsen
ab8d5e261a url: support dash '-' in urls 2024-02-02 02:45:48 +01:00
Erlend Lind Madsen
4475f5b9c5 url/Link: simplify regex, remove 'find_longest' param and add new tests 2024-02-02 01:23:39 +01:00
Selman Kayrancioglu
9348561bc7 config/url: exclude trailing single quotes 2024-01-27 21:59:37 +03:00
Caleb Spare
ae94af37c0 config: improve link matching for URLs ending in . or )
Fixes #1098
2023-12-16 17:34:38 -08:00
Mitchell Hashimoto
5db002cb12 renderer/metal: underline urls 2023-11-29 15:30:21 -08:00