diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-05-15 01:06:36 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-07-05 11:34:35 +0900 |
commit | f88a9097a4708e8c179eead4e67ee67f15fcdefe (patch) | |
tree | c5a8a3c96467a447bc13612d816018408032f09b /lib/rdoc | |
parent | 7c8aa0a5d2bc3f079077d113b350a58d7b7c2b0d (diff) |
[ruby/rdoc] Fix for explicit http link
https://github.com/ruby/rdoc/commit/caf234665c
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/markup/to_html.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb index 6a8ca8a2d7..f3dd96e157 100644 --- a/lib/rdoc/markup/to_html.rb +++ b/lib/rdoc/markup/to_html.rb @@ -357,8 +357,8 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then "<img src=\"#{url}\" />" else - if scheme != 'link' and %r%\A([./]*+)(.*?\.)(rb|rdoc|md)(?=\z|#)%i =~ url - url = "#$1#{$2.tr('.', '_')}#$3.html#{$'}" + if scheme != 'link' and %r%\A((?!https?:).*/)([^/]+)\.(rb|rdoc|md)(?=\z|#)%i =~ url + url = "#$1#{$2.tr('.', '_')}_#$3.html#$'" end text = text.sub %r%^#{scheme}:/*%i, '' |