Skip to content

Commit

Permalink
dep: update libxml2 to v2.9.14
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed May 2, 2022
1 parent b8802bf commit ccfc287
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 63 deletions.
6 changes: 3 additions & 3 deletions dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
libxml2:
version: "2.9.13"
sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e"
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.sha256sum
version: "2.9.14"
sha256: "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.sha256sum

libxslt:
version: "1.1.35"
Expand Down

This file was deleted.

29 changes: 21 additions & 8 deletions test/html4/test_comments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,32 @@ class TestComment < Nokogiri::TestCase
let(:subject) { doc.at_css("div#under-test") }

if Nokogiri.uses_libxml?
it "ignores up to the next '>'" do # NON-COMPLIANT
assert_equal 2, body.children.length
assert_equal body.children[0], subject
assert_equal 1, subject.children.length
assert_predicate subject.children[0], :text?
assert_equal "inner content", subject.children[0].content
assert_predicate body.children[1], :text?
assert_equal "-->hello", body.children[1].content
it "parsed as pcdata" do # NON-COMPLIANT
assert_equal 1, body.children.length
assert_equal subject, body.children.first

assert_equal 3, subject.children.length
subject.children[0].tap do |child|
assert_predicate(child, :text?)
assert_equal("<! comment ", child.content)
end
subject.children[1].tap do |child|
assert_predicate(child, :element?)
assert_equal("div", child.name)
assert_equal("inner content", child.content)
end
subject.children[2].tap do |child|
assert_predicate(child, :text?)
assert_equal("-->hello", child.content)
end
end
end

if Nokogiri.jruby?
it "ignores up to the next '-->'" do # NON-COMPLIANT
assert_equal 1, body.children.length
assert_equal subject, body.children.first

assert_equal 1, subject.children.length
assert_predicate subject.children[0], :text?
assert_equal "hello", subject.children[0].content
Expand Down
7 changes: 0 additions & 7 deletions test/html4/test_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -801,16 +801,9 @@ def test_leaking_dtd_nodes_after_internal_subset_removal

it "skips to the next start tag" do
# see https://github.com/sparklemotion/nokogiri/issues/2461 for why we're testing this edge case
if Nokogiri.uses_libxml?(">= 2.9.13")
skip_unless_libxml2_patch("0010-Revert-Different-approach-to-fix-quadratic-behavior.patch")
end

doc = Nokogiri::HTML4.parse(input)
body = doc.at_xpath("//body")

expected_error_snippet = Nokogiri.uses_libxml? ? "invalid element name" : "Missing start element name"
assert_includes(doc.errors.first.to_s, expected_error_snippet)

assert_equal("this < that", body.children.first.text, body.to_html)
assert_equal(["div", "div"], body.children.map(&:name), body.to_html)
end
Expand Down

0 comments on commit ccfc287

Please sign in to comment.