Created
September 21, 2013 09:01
-
-
Save jkeyes/6648763 to your computer and use it in GitHub Desktop.
Nokogiri doesn't appear to support HTML5 validation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby noko.rb | |
Tag header invalid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment