Skip to content

Commit 0012812

Browse files
committed
Move method source to correct location on newer rdoc
Source was being moved above the header for ruby 4.0
1 parent 5f46568 commit 0012812

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/docs/filters/rdoc/clean_html.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def other
5252

5353
# Add class to differentiate Ruby code from C code
5454
css('.method-source-code').each do |node|
55-
node.parent.prepend_child(node)
55+
header = node.ancestors('.method-detail').first.at_css('.method-header')
56+
header.add_next_sibling(node)
5657
pre = node.at_css('pre')
5758
pre['class'] = pre.at_css('.ruby-keyword') ? 'ruby' : 'c'
5859
end

0 commit comments

Comments
 (0)