summaryrefslogtreecommitdiff
path: root/lib/rdoc
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-08-08 16:35:34 +0900
committeraycabta <aycabta@gmail.com>2019-08-16 06:02:45 +0900
commit64f9f512c5837207436203c0ca47523cca2ecc62 (patch)
treeec34f3d286685938bfc669191bc1f798b56374d9 /lib/rdoc
parent723a37d0386bc20efedf516656c2ccafa889c89d (diff)
Treat linking to Markdown label correctly
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rdoc/markup/to_html_crossref.rb b/lib/rdoc/markup/to_html_crossref.rb
index 4a1350a73c..9314f04fae 100644
--- a/lib/rdoc/markup/to_html_crossref.rb
+++ b/lib/rdoc/markup/to_html_crossref.rb
@@ -153,7 +153,11 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
ref.sections.any? { |section| label == section.title } then
path << "##{label}"
else
- path << "##{ref.aref}-label-#{label}"
+ if ref.respond_to?(:aref)
+ path << "##{ref.aref}-label-#{label}"
+ else
+ path << "#label-#{label}"
+ end
end if label
"<a href=\"#{path}\">#{text}</a>"