Skip to content

Instantly share code, notes, and snippets.

@statonjr
Created June 21, 2012 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statonjr/2965699 to your computer and use it in GitHub Desktop.
Save statonjr/2965699 to your computer and use it in GitHub Desktop.
Nokogiri JRuby issue
require 'nokogiri'
html = <<-EOS
<!DOCTYPE html>
<html>
<head>
<title>JRuby Nokogiri Test</title>
</head>
<body>
<p>Test</p>
</body>
</html>
EOS
doc = Nokogiri::HTML::Document.parse(html)
puts doc.to_html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>JRuby Nokogiri Test</title>
</head>
<body>
<p>Test</p>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment