diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 7e89e4f86ac..b76555b7ef6 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9351 \ No newline at end of file +9352 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index e144bc3fc28..d68f0b5851b 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -1fbcede24288ad8abdeaf49255e5c0996ac2df4c \ No newline at end of file +1fa1aa54ae725989c6c44f198376e37ba000ca02 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Markdown.pm b/mozilla/webtools/bugzilla/Bugzilla/Markdown.pm index 7b5d475f82d..bbb5b0f2701 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Markdown.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Markdown.pm @@ -237,7 +237,7 @@ sub _DoAnchors { }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) # @@ -256,6 +256,22 @@ sub _DoAnchors { $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; }