summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup/to_html.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-01 05:39:13 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-05 11:34:37 +0900
commit3dacc14fd3dded7feda31c195f6bf6c096c91e21 (patch)
treec116b9800448a2686460baceb35bdae13b14f1b2 /lib/rdoc/markup/to_html.rb
parentf88a9097a4708e8c179eead4e67ee67f15fcdefe (diff)
[ruby/rdoc] Fix links without paths
https://github.com/ruby/rdoc/commit/424bd5db4d
Diffstat (limited to 'lib/rdoc/markup/to_html.rb')
-rw-r--r--lib/rdoc/markup/to_html.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb
index f3dd96e157..d3bb8af835 100644
--- a/lib/rdoc/markup/to_html.rb
+++ b/lib/rdoc/markup/to_html.rb
@@ -357,7 +357,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
"<img src=\"#{url}\" />"
else
- if scheme != 'link' and %r%\A((?!https?:).*/)([^/]+)\.(rb|rdoc|md)(?=\z|#)%i =~ url
+ if scheme != 'link' and %r%\A((?!https?:)(?:[^/#]*/)*+)([^/#]+)\.(rb|rdoc|md)(?=\z|#)%i =~ url
url = "#$1#{$2.tr('.', '_')}_#$3.html#$'"
end