mirror of
https://github.com/kovidgoyal/kitty.git
synced 2025-12-13 20:36:22 +01:00
kitten/hints/marks support for IPv6 addresses ending in ::
IPv6 addresses can end in zeros, and for example ifconfig.me is at 2600:1901:0:b2bd::.
This commit is contained in:
@@ -375,7 +375,7 @@ func functions_for(opts *Options) (pattern string, post_processors []PostProcess
|
||||
// IPv4 with no validation
|
||||
`((?:\d{1,3}\.){3}\d{1,3}` + "|" +
|
||||
// IPv6 with no validation
|
||||
`(?:[a-fA-F0-9]{0,4}:){2,7}[a-fA-F0-9]{1,4})`)
|
||||
`(?:[a-fA-F0-9]{0,4}:){2,7}[a-fA-F0-9]{0,4})`)
|
||||
post_processors = append(post_processors, PostProcessorMap()["ip"])
|
||||
default:
|
||||
pattern = opts.Regex
|
||||
|
||||
@@ -104,6 +104,7 @@ func TestHintMarking(t *testing.T) {
|
||||
r(`2001:db8::ff00:42:8329`, `2001:db8::ff00:42:8329`)
|
||||
r(`2001:DB8::FF00:42:8329`, `2001:DB8::FF00:42:8329`)
|
||||
r(`0000:0000:0000:0000:0000:0000:0000:0001`, `0000:0000:0000:0000:0000:0000:0000:0001`)
|
||||
r(`2600:1901:0:b2bd::`, `2600:1901:0:b2bd::`) // ifconfig.me
|
||||
r(`::1`, `::1`)
|
||||
r(`255.255.255.256`)
|
||||
r(`:1`)
|
||||
|
||||
Reference in New Issue
Block a user