diff --git a/lib/nekohtml.jar b/lib/nekohtml.jar
index d9f245b0432..1303f1d5570 100644
Binary files a/lib/nekohtml.jar and b/lib/nekohtml.jar differ
diff --git a/lib/nokogiri/xml/node.rb b/lib/nokogiri/xml/node.rb
index 59bb2da2240..09b12788b48 100644
--- a/lib/nokogiri/xml/node.rb
+++ b/lib/nokogiri/xml/node.rb
@@ -123,7 +123,7 @@ class Node
# [Yields] Nokogiri::XML::Node
# [Returns] Nokogiri::XML::Node
#
- def initialize(name, document)
+ def initialize(name, document) # rubocop:disable Style/RedundantInitialize
# This is intentionally empty.
end
diff --git a/lib/nokogiri/xml/processing_instruction.rb b/lib/nokogiri/xml/processing_instruction.rb
index 3865037d436..8e5c19d9738 100644
--- a/lib/nokogiri/xml/processing_instruction.rb
+++ b/lib/nokogiri/xml/processing_instruction.rb
@@ -3,7 +3,7 @@
module Nokogiri
module XML
class ProcessingInstruction < Node
- def initialize(document, name, content)
+ def initialize(document, name, content) # rubocop:disable Style/RedundantInitialize
end
end
end
diff --git a/test/html4/test_document.rb b/test/html4/test_document.rb
index c253fd1c971..7468ece78b6 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 = %{