From 64f9f512c5837207436203c0ca47523cca2ecc62 Mon Sep 17 00:00:00 2001 From: aycabta Date: Thu, 8 Aug 2019 16:35:34 +0900 Subject: Treat linking to Markdown label correctly --- lib/rdoc/markup/to_html_crossref.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/rdoc') 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 "#{text}" -- cgit v1.2.3