diff --git a/lib/nekohtml.jar b/lib/nekohtml.jar
index d9f245b043..1303f1d557 100644
Binary files a/lib/nekohtml.jar and b/lib/nekohtml.jar differ
diff --git a/test/html4/test_document.rb b/test/html4/test_document.rb
index c253fd1c97..7468ece78b 100644
--- a/test/html4/test_document.rb
+++ b/test/html4/test_document.rb
@@ -727,6 +727,17 @@ def test_silencing_nonparse_errors_during_attribute_insertion_1262
assert_equal(0, doc.errors.length)
end
+ def test_leaking_dtd_nodes_after_internal_subset_removal
+ # see https://github.com/sparklemotion/nokogiri/issues/1784
+ #
+ # just checking that this doesn't raise a valgrind error. we
+ # don't otherwise have any test coverage for removing DTDs.
+ #
+ 100.times do |_i|
+ Nokogiri::HTML::Document.new.internal_subset.remove
+ end
+ end
+
it "skips encoding for script tags" do
html = Nokogiri::HTML(<<~EOHTML)
@@ -763,15 +774,17 @@ def test_silencing_nonparse_errors_during_attribute_insertion_1262
assert_equal "ISO-8859-1", html.encoding.name
end
- def test_leaking_dtd_nodes_after_internal_subset_removal
- # see https://github.com/sparklemotion/nokogiri/issues/1784
- #
- # just checking that this doesn't raise a valgrind error. we
- # don't otherwise have any test coverage for removing DTDs.
- #
- 100.times do |_i|
- Nokogiri::HTML::Document.new.internal_subset.remove
+ it "handles ill-formed processing instructions" do
+ html = %{