4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/detergent/matchers/obvious_junk_matcher.rb', line 4
def match?(node)
tag = node.name.downcase
return true if %w(script style link iframe noscript).include?(tag)
return true if node['aria-hidden'] == 'true'
style = node['style'].to_s.downcase
return true if style.include?('display:none') || style.include?('display: none')
return true if %w(nav header footer).include?(tag)
return true if node['role'].to_s.downcase == 'navigation'
false
end
|