diff options
author | Eric Wong <e@80x24.org> | 2019-02-01 05:27:52 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-02-01 05:27:52 +0000 |
commit | 58700fb1830d1f854e688dfa47390d7f2eef9035 (patch) | |
tree | 9d6b814d257bf2381198a0b276f06aa055ad9f4a /lib/PublicInbox/Linkify.pm | |
parent | 7475739ec4e426004619f95f6e48fa07d940a5c0 (diff) | |
download | public-inbox-58700fb1830d1f854e688dfa47390d7f2eef9035.tar.gz |
Sometimes users will write "http://example.com" without the trailing slash, which every browser and tool I've tested seems to understand.
Diffstat (limited to 'lib/PublicInbox/Linkify.pm')
-rw-r--r-- | lib/PublicInbox/Linkify.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Linkify.pm b/lib/PublicInbox/Linkify.pm index 274f3820..aa472cdb 100644 --- a/lib/PublicInbox/Linkify.pm +++ b/lib/PublicInbox/Linkify.pm @@ -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] } |