summaryrefslogtreecommitdiff
path: root/lib/rdoc
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-05-02 14:09:21 +0900
committergit <svn-admin@ruby-lang.org>2023-05-02 05:42:37 +0000
commite47aa27dc799213066732fc7e34f2eeaf059b001 (patch)
tree5903e76d3f4787066fe131516b2c037c224a2597 /lib/rdoc
parent3833d0fee6e7c8747a153d0f3e31405b16ae57e3 (diff)
[ruby/rdoc] Section may not have `label`
https://github.com/ruby/rdoc/commit/945f0cb3e9
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/generator/template/darkfish/table_of_contents.rhtml5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
index 09b5379fc0..c8a422a521 100644
--- a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
+++ b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
@@ -36,8 +36,9 @@
unless table.empty? then %>
<ul>
<%- table.each do |item| -%>
- <li><a href="<%= klass.path %>#<%= item.label(klass) %>"><%= item.plain_html %></a>
-<%- end -%>
+<%- label = item.respond_to?(:label) ? item.label(klass) : item.aref -%>
+ <li><a href="<%= klass.path %>#<%= label %>"><%= item.plain_html %></a>
+<%- end -%>
</ul>
<%- end -%>
</li>