Browse Source

Update DOM documentation

Thibaut 12 years ago
parent
commit
40c1dda27d

+ 6 - 1
lib/docs/filters/dom/clean_html.rb

@@ -20,7 +20,12 @@ module Docs
 
         # Remove double heading on SVG pages
         if slug.start_with? 'SVG'
-          at_css('h2:first-child').try(:remove)
+          at_css('h2:first-child').try :remove
+        end
+
+        # Remove <div> wrapping .overheadIndicator
+        css('div > .overheadIndicator:first-child:last-child').each do |node|
+          node.parent.replace(node)
         end
       end
     end

+ 3 - 7
lib/docs/filters/dom/entries.rb

@@ -104,13 +104,9 @@ module Docs
       end
 
       def include_default_entry?
-        if (node = at_css('.obsolete', '.deprecated')) &&
-           (node.inner_html.include?('removed from the Web') ||
-            node.inner_html.include?('Try to avoid using it'))
-          false
-        else
-          true
-        end
+        !(node = doc.at_css '.overheadIndicator') ||
+        !node.content.include?('not on a standards track') &&
+        !node.content.include?('removed from the Web')
       end
     end
   end

+ 1 - 0
lib/docs/scrapers/mdn/dom.rb

@@ -68,6 +68,7 @@ module Docs
       /\A\/navigator\.id/i,
       /\A\/Settings/,
       /\A\/Telephony/,
+      /\A\/Bluetooth/,
       /UserData/,
       /\A\/Window\.\w+bar/i]