]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
linkify: give <a> tags to gemini:// URLs
authorEric Wong <e@80x24.org>
Fri, 11 Apr 2025 18:35:51 +0000 (18:35 +0000)
committerEric Wong <e@80x24.org>
Mon, 14 Apr 2025 08:36:19 +0000 (08:36 +0000)
While I still think serving the Gemini text and protocol is
unnecessary bloat on our part, there are web browsers with
gemini:// support, so we might as well support it.

lib/PublicInbox/Linkify.pm

index 306a57e77c73d03b99a4ddfd99f98f6119e457db..02df9588e681044aed00af85cf8f7a76d49b2616 100644 (file)
@@ -17,7 +17,8 @@ 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?|imaps?|s?news|gopher)://
+my $LINK_RE = qr{([\('!])?\b(
+               (?:ftps?|https?|nntps?|imaps?|s?news|gopher|gemini)://
                 [\@:\w\.-]+(?:/
                 (?:[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]*)
                 (?:\?[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]+)?