Bladeren bron

Fix 'notable traits' sections

MasterEnoc 5 jaren geleden
bovenliggende
commit
0a2493eca7
1 gewijzigde bestanden met toevoegingen van 12 en 14 verwijderingen
  1. 12 14
      lib/docs/filters/rust/clean_html.rb

+ 12 - 14
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