Skip to content

Instantly share code, notes, and snippets.

@jkeyes
Created September 21, 2013 09:01
Show Gist options
  • Save jkeyes/6648763 to your computer and use it in GitHub Desktop.
Save jkeyes/6648763 to your computer and use it in GitHub Desktop.
Nokogiri doesn't appear to support HTML5 validation.
require 'rubygems'
require 'nokogiri'
markup = <<-eom
<!DOCTYPE html>
<html>
<body>
<header>
<h1>HTML5</h1>
</header>
</body>
</html>
eom
html_doc = Nokogiri::HTML(markup) do |config|
config.strict
end
puts html_doc.errors
$ ruby noko.rb
Tag header invalid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment