From f401be8bf5612178074d8d037776fee9e27bfd4c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 30 Aug 2015 00:12:31 +0000 Subject: view: update linkification regexp to be more domain sensitive This avoids capturing links such as "http://#{foo}" => "http://#" inside diffs --- lib/PublicInbox/View.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 08d78945..bd0a27aa 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -244,7 +244,9 @@ sub add_filename_line { "$pad " . ascii_html($fn) . " $pad\n"; } -my $LINK_RE = qr!\b((?:ftp|https?|nntp)://[@\w\+\&\?\.\%\;/#=-]+)!; +my $LINK_RE = qr!\b((?:ftp|https?|nntp):// + [\@:\w\.-]+/ + ?[\@\w\+\&\?\.\%\;/#=-]*)!x; sub linkify { # no newlines added here since it'd break the splitting we do -- cgit v1.2.3-24-ge0c7