diff options
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 8ae4dd4720..6a8ca8a2d7 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 /\.(?:rb|rdoc|md)\z/i =~ url - url = url.sub(%r%\A([./]*)(.*)\z%) { "#$1#{$2.tr('.', '_')}.html" } + if scheme != 'link' and %r%\A([./]*+)(.*?\.)(rb|rdoc|md)(?=\z|#)%i =~ url + url = "#$1#{$2.tr('.', '_')}#$3.html#{$'}" end text = text.sub %r%^#{scheme}:/*%i, '' |