diff --git a/lib/docs/filters/rust/clean_html.rb b/lib/docs/filters/rust/clean_html.rb index 682bf484..245ed701 100644 --- a/lib/docs/filters/rust/clean_html.rb +++ b/lib/docs/filters/rust/clean_html.rb @@ -27,6 +27,18 @@ module Docs end end + # Fix notable trait sections + css('.method, .rust.trait').each do |node| + traitSection = node.at_css('.notable-traits') + + if traitSection + traitSectionContent = traitSection.css('.notable-traits-tooltiptext') + traitSection.css('.notable-traits-tooltip').remove + traitSection.add_child(traitSectionContent) + node.after(traitSection) + end + end + css('.rusttest', '.test-arrow', 'hr').remove css('.docblock.attributes').each do |node| @@ -88,20 +100,6 @@ module Docs css('.collapse-toggle').remove - # Fix how notable-traits sections are shown - - css('.method').each do |node| - traitSection = node.at_css('.notable-traits') - - if traitSection - traitSectionContent = traitSection.css('.notable-traits-tooltiptext') - traitSection.css('.notable-traits-tooltip').remove - traitSection.add_child(traitSectionContent) - node.after(traitSection) - end - - end - doc end end