Class: HtmlCheck
- Inherits:
-
HTML::Proofer::CheckRunner
- Object
- HTML::Proofer::CheckRunner
- HtmlCheck
- Defined in:
- lib/html/proofer/checks/html.rb
Constant Summary collapse
- HTML5_TAGS =
new html5 tags (source: www.w3schools.com/html/html5_new_elements.asp)
%w(article aside bdi details dialog figcaption figure footer header main mark menuitem meter nav progress rp rt ruby section summary time wbr datalist keygen output color date datetime datetime-local email month number range search tel time url week canvas svg audio embed source track video)
Instance Attribute Summary
Attributes inherited from HTML::Proofer::CheckRunner
#alt_ignores, #external_urls, #href_ignores, #hydra_opts, #issues, #options, #parallel_opts, #path, #src, #typhoeus_opts
Instance Method Summary collapse
Methods inherited from HTML::Proofer::CheckRunner
#add_issue, #add_to_external_urls, checks, #initialize
Constructor Details
This class inherits a constructor from HTML::Proofer::CheckRunner
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/html/proofer/checks/html.rb', line 14 def run @html.errors.each do |e| # Nokogiri (or rather libxml2 underhood) only recognizes html4 tags, # so we need to skip errors caused by the new tags in html5 next if HTML5_TAGS.include? e.to_s[/Tag ([\w-]+) invalid/o, 1] add_issue(e.to_s) end end |