}xsge;
#
- # Last, handle reference-style shortcuts: [link text]
+ # Handle reference-style shortcuts: [link text]
# These must come last in case you've also got [link test][1]
# or [link test](/foo)
#
$self->_GenerateAnchor($whole_match, $link_text, $link_id);
}xsge;
+ # Last, handle "naked" references
+ # Caveat, does not handle ;http://amazon.com
+ my $safe_url_regexp = Bugzilla::Template::SAFE_URL_REGEXP();
+ $text =~ s{
+ (
+ (^|(?<![;^"'<>])) # negative lookbehind, including ';' in '<'
+ ( # wrap url in $3
+ (?:https?|ftp):[^'">\s]+\w
+ )
+ )
+ }{
+ my $whole_match = $3;
+ my $url = $whole_match;
+ $self->_GenerateAnchor($whole_match, $url, undef, $url, undef);
+ }xsge;
+
return $text;
}