History

Move method source to correct location on newer rdoc

Source was being moved above the header for ruby 4.0

Dan Arnfield committed 8 months ago

Commit 00128121 parent 5f465681 file · +2 −1Browse files

Unified · Split

lib/docs/filters/rdoc/clean_html.rb+2−1
@@ -52,7 +52,8 @@ module Docs · 51 unmodified lines
52 52
53 # Add class to differentiate Ruby code from C code53 # Add class to differentiate Ruby code from C code
54 css('.method-source-code').each do |node|54 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)
56 pre = node.at_css('pre')57 pre = node.at_css('pre')
57 pre['class'] = pre.at_css('.ruby-keyword') ? 'ruby' : 'c'58 pre['class'] = pre.at_css('.ruby-keyword') ? 'ruby' : 'c'
58 end59 end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t