We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be50790 commit 5f46568Copy full SHA for 5f46568
1 file changed
lib/docs/filters/rdoc/clean_html.rb
@@ -42,7 +42,9 @@ def other
42
link_node.content = 'Show source'
43
link_node['class'] = 'method-click-advice'
44
45
- node.parent.parent.at_css('.method-heading').add_child(link_node)
+ # Only add "Show source" if source is present
46
+ method_root = node.ancestors('.method-detail').first
47
+ method_root.at_css('.method-heading').add_child(link_node) if method_root.at_css('.method-source-code')
48
end
49
50
# (RDoc for Ruby 3.4+) Remove the additional "Source" toggle from the page
0 commit comments