]> Sergey Matveev's repositories - public-inbox.git/commitdiff
linkify: support imap, imaps, news, and snews URIs
authorEric Wong <e@yhbt.net>
Fri, 26 Jun 2020 23:26:18 +0000 (23:26 +0000)
committerEric Wong <e@yhbt.net>
Sat, 27 Jun 2020 18:34:47 +0000 (18:34 +0000)
Since we'll have an IMAP server released soon, maybe imaps://
and imap:// URLs can become popular.

news:// is defined with nntp:// in RFC 5538, and we can at least
support the news:// form in rendered HTML.  snews:// may appear
in old mail archives, too, so we'll attempt to support it in
case clients do.

lib/PublicInbox/Linkify.pm

index b85bedfed9aa6f3bfdf2102e2311b52c573b7786..a02eafc4fc6bdd6ab93b4a4ec0b1d2c2f55ca0cb 100644 (file)
@@ -17,7 +17,7 @@ use PublicInbox::Hval qw(ascii_html mid_href);
 use PublicInbox::MID qw($MID_EXTRACT);
 
 my $SALT = rand;
-my $LINK_RE = qr{([\('!])?\b((?:ftps?|https?|nntps?|gopher)://
+my $LINK_RE = qr{([\('!])?\b((?:ftps?|https?|nntps?|imaps?|s?news|gopher)://
                 [\@:\w\.-]+(?:/
                 (?:[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]*)
                 (?:\?[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]+)?