Created
May 14, 2016 22:45
-
-
Save junaruga/65d0ab59f1bede2d6047ce4002e390f6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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' | |
| puts Nokogiri::VERSION | |
| module Nokogiri | |
| module HTML | |
| class Document < Nokogiri::XML::Document | |
| class << self | |
| def test_for_parse | |
| expect = <<'EOS' | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> | |
| <html><body>b</body></html> | |
| EOS | |
| html = '<<a>b' | |
| doc = read_memory("<html><body>#{html}", nil, "UTF-8", 2145) | |
| puts doc.to_s | |
| p(doc.to_s == expect) | |
| end | |
| end | |
| end | |
| end | |
| end | |
| Nokogiri::HTML::Document.test_for_parse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment