aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-04-14 17:43:15 +0200
committerRobin Jarry <robin@jarry.cc>2023-04-22 23:44:33 +0200
commit44b6c52ac342b1bc75ca565c3787e0b963259476 (patch)
tree6882a782510bacbd72af38fdd7f2f3f75d3181be
parentc7f5f2cf4c2a043ce36ec486fe0d9203020c8744 (diff)
downloadaerc-44b6c52ac342b1bc75ca565c3787e0b963259476.tar.gz
colorize: support email domains that start/end with digits
According to RFC 1123: "... a host domain name is now allowed to begin with a digit and could legally be entirely numeric ..." Link: https://datatracker.ietf.org/doc/html/rfc1123#section-2 Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
-rw-r--r--filters/colorize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/filters/colorize.c b/filters/colorize.c
index 51bcdbe9..5122b241 100644
--- a/filters/colorize.c
+++ b/filters/colorize.c
@@ -457,7 +457,7 @@ static inline bool isurichar(char c)
#define URL_RE \
"([a-z]{2,8})://" \
- "|(mailto:)?[[:alnum:]_+.~/-]*[[:alnum:]]@[a-z][[:alnum:].-]*[a-z]"
+ "|(mailto:)?[[:alnum:]_+.~/-]*[[:alnum:]]@[[:alnum:]][[:alnum:].-]*[[:alnum:]]"
static regex_t url_re;
static void urls(const char *in, struct style *ctx)