Sha256: 6b61606b0b1d40eb9c255a20e4734459bde704248c8c22aed88087cb673b60ea

Contents?: true

Size: 875 Bytes

Versions: 6

Compression:

Stored size: 875 Bytes

Contents

# encoding: utf-8

class Html < ::HTML::Proofer::Checks::Check

  # new html5 tags (source: http://www.w3schools.com/html/html5_new_elements.asp)
  HTML5_TAGS = %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)

  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]

        self.add_issue(e.to_s)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
html-proofer-1.6.0 lib/html/proofer/checks/html.rb
html-proofer-1.5.4 lib/html/proofer/checks/html.rb
html-proofer-1.5.3 lib/html/proofer/checks/html.rb
html-proofer-1.5.2 lib/html/proofer/checks/html.rb
html-proofer-1.5.1 lib/html/proofer/checks/html.rb
html-proofer-1.5.0 lib/html/proofer/checks/html.rb