From 40c1dda27d889621ad704c9f55665dadc4904b1c Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sat, 7 Dec 2013 16:21:10 +0000 Subject: [PATCH] Update DOM documentation --- lib/docs/filters/dom/clean_html.rb | 7 ++++++- lib/docs/filters/dom/entries.rb | 10 +++------- lib/docs/scrapers/mdn/dom.rb | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/docs/filters/dom/clean_html.rb b/lib/docs/filters/dom/clean_html.rb index a022e075..ad04ea3c 100644 --- a/lib/docs/filters/dom/clean_html.rb +++ b/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
wrapping .overheadIndicator + css('div > .overheadIndicator:first-child:last-child').each do |node| + node.parent.replace(node) end end end diff --git a/lib/docs/filters/dom/entries.rb b/lib/docs/filters/dom/entries.rb index 6df28a2e..9e30d4ab 100644 --- a/lib/docs/filters/dom/entries.rb +++ b/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 diff --git a/lib/docs/scrapers/mdn/dom.rb b/lib/docs/scrapers/mdn/dom.rb index 0617f2e9..dda78654 100644 --- a/lib/docs/scrapers/mdn/dom.rb +++ b/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]