]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Linkify.pm
linkify: support proto://hostname without trailing slash
[public-inbox.git] / lib / PublicInbox / Linkify.pm
index 274f38209fa3a2c1a880b20a2c9c28a4a94e603a..aa472cdb7167473d2706e069073eb9ef7683aa51 100644 (file)
@@ -16,11 +16,12 @@ use Digest::SHA qw/sha1_hex/;
 
 my $SALT = rand;
 my $LINK_RE = qr{(\()?\b((?:ftps?|https?|nntps?|gopher)://
-                [\@:\w\.-]+/
+                [\@:\w\.-]+(?:/
                 (?:[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]*)
                 (?:\?[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]+)?
                 (?:\#[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%\?]+)?
-                )}xi;
+                )?
+               )}xi;
 
 sub new { bless {}, $_[0] }