Browse Source

Remove unnecessary `onclick` attributes in Rust docs

Calum Smith 3 months ago
parent
commit
d777a8a3fb
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/docs/filters/rust/clean_html.rb

+ 4 - 0
lib/docs/filters/rust/clean_html.rb

@@ -65,6 +65,10 @@ module Docs
             node.add_child(next_element)
           end
 
+          node.css('[onclick="show_railroad()"]').each do |subnode|
+            subnode.remove_attribute('onclick')
+          end
+
           # We changed this to a <pre> in parse(), changing it back here
           node.name = 'div'
           node.css('.grammar-literal').each do |literal|