diff options
author | aycabta <aycabta@gmail.com> | 2019-08-08 16:35:34 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-08-16 06:02:45 +0900 |
commit | 64f9f512c5837207436203c0ca47523cca2ecc62 (patch) | |
tree | ec34f3d286685938bfc669191bc1f798b56374d9 /lib | |
parent | 723a37d0386bc20efedf516656c2ccafa889c89d (diff) | |
download | ruby-64f9f512c5837207436203c0ca47523cca2ecc62.tar.gz |
Treat linking to Markdown label correctly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/markup/to_html_crossref.rb | 6 |
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>" |