diff --git a/CHANGELOG.md b/CHANGELOG.md index fb7af2d248..78af34ba50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA ## v1.next / unreleased +### Dependencies + +* [CRuby] Vendored libxml2 is updated to [v2.13.0](https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.13.0). @flavorjones +* [CRuby] Vendored libxslt is updated to [v1.1.40](https://gitlab.gnome.org/GNOME/libxslt/-/releases/v1.1.40). @flavorjones + + ### Added * [CRuby] `Nokogiri::HTML5::Builder` is similar to `HTML4::Builder` but returns an `HTML5::Document`. @flavorjones diff --git a/dependencies.yml b/dependencies.yml index 950d77a71e..44e3a32a08 100644 --- a/dependencies.yml +++ b/dependencies.yml @@ -1,13 +1,13 @@ --- libxml2: - version: "2.12.8" - sha256: "43ad877b018bc63deb2468d71f95219c2fac196876ef36d1bee51d226173ec93" - # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.8.sha256sum + version: "2.13.0" + sha256: "d5a2f36bea96e1fb8297c6046fb02016c152d81ed58e65f3d20477de85291bc9" + # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.0.sha256sum libxslt: - version: "1.1.39" - sha256: "2a20ad621148339b0759c4d4e96719362dee64c9a096dbba625ba053846349f0" - # sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.39.sha256sum + version: "1.1.40" + sha256: "194715db023035f65fb566402f2ad2b5eab4c29d541f511305c40b29b1f48d13" + # sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.40.sha256sum zlib: version: "1.3.1" diff --git a/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch b/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch deleted file mode 100644 index b6add83769..0000000000 --- a/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0b6ae484761fa01242fe8b67b54e3eb2d282d83d Mon Sep 17 00:00:00 2001 -From: Mike Dalessio -Date: Wed, 4 Dec 2019 08:43:51 -0500 -Subject: [PATCH] fix libxml2.la's path - ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.in b/Makefile.in -index cf96d41..1372d8b 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -1057,7 +1057,7 @@ clean-noinstLTLIBRARIES: - rm -f $${locs}; \ - } - --libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES) -+$(top_builddir)/libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES) - $(AM_V_CCLD)$(libxml2_la_LINK) -rpath $(libdir) $(libxml2_la_OBJECTS) $(libxml2_la_LIBADD) $(LIBS) - - testdso.la: $(testdso_la_OBJECTS) $(testdso_la_DEPENDENCIES) $(EXTRA_testdso_la_DEPENDENCIES) --- -2.17.1 - diff --git a/rakelib/extensions.rake b/rakelib/extensions.rake index 66867f407f..3181dfed85 100644 --- a/rakelib/extensions.rake +++ b/rakelib/extensions.rake @@ -136,18 +136,18 @@ CrossRuby = Struct.new(:version, :platform) do case platform when MINGW32_PLATFORM_REGEX [ + "advapi32.dll", + "bcrypt.dll", "kernel32.dll", "msvcrt.dll", - "ws2_32.dll", "user32.dll", - "advapi32.dll", + "ws2_32.dll", libruby_dll, ] when MINGWUCRT_PLATFORM_REGEX [ - "kernel32.dll", - "ws2_32.dll", "advapi32.dll", + "bcrypt.dll", "api-ms-win-crt-convert-l1-1-0.dll", "api-ms-win-crt-environment-l1-1-0.dll", "api-ms-win-crt-filesystem-l1-1-0.dll", @@ -160,22 +160,24 @@ CrossRuby = Struct.new(:version, :platform) do "api-ms-win-crt-string-l1-1-0.dll", "api-ms-win-crt-time-l1-1-0.dll", "api-ms-win-crt-utility-l1-1-0.dll", + "kernel32.dll", + "ws2_32.dll", libruby_dll, ] when X86_LINUX_PLATFORM_REGEX [ - "libm.so.6", "libc.so.6", "libdl.so.2", # on old dists only - now in libc + "libm.so.6", ].tap do |dlls| dlls << "libpthread.so.0" if ver >= "3.2.0" end when AARCH_LINUX_PLATFORM_REGEX [ - "libm.so.6", + "ld-linux-aarch64.so.1", "libc.so.6", "libdl.so.2", # on old dists only - now in libc - "ld-linux-aarch64.so.1", + "libm.so.6", ].tap do |dlls| dlls << "libpthread.so.0" if ver >= "3.2.0" end @@ -187,10 +189,10 @@ CrossRuby = Struct.new(:version, :platform) do ] when ARM_LINUX_PLATFORM_REGEX [ - "libm.so.6", - "libdl.so.2", - "libc.so.6", "ld-linux-armhf.so.3", + "libc.so.6", + "libdl.so.2", + "libm.so.6", ].tap do |dlls| dlls << "libpthread.so.0" if ver >= "3.2.0" end @@ -255,7 +257,7 @@ def verify_dll(dll, cross_ruby) raise "export function Init_nokogiri not in dll #{dll}" unless /Table.*\sInit_nokogiri\s/mi.match?(dump) # Verify that the DLL dependencies are all allowed. - actual_imports = dump.scan(/DLL Name: (.*)$/).map { |name| name.first.downcase }.uniq + actual_imports = dump.scan(/DLL Name: (.*)$/).map { |name| name.first.downcase }.uniq.sort unless (actual_imports - allowed_imports).empty? raise "unallowed so imports #{actual_imports.inspect} in #{dll} (allowed #{allowed_imports.inspect})" end @@ -268,7 +270,7 @@ def verify_dll(dll, cross_ruby) raise "export function Init_nokogiri not in dll #{dll}" unless nm.include?(" T Init_nokogiri") # Verify that the DLL dependencies are all allowed. - actual_imports = dump.scan(/NEEDED\s+(.*)/).map(&:first).uniq + actual_imports = dump.scan(/NEEDED\s+(.*)/).map(&:first).uniq.sort unless (actual_imports - allowed_imports).empty? raise "unallowed so imports #{actual_imports.inspect} in #{dll} (allowed #{allowed_imports.inspect})" end @@ -306,7 +308,7 @@ def verify_dll(dll, cross_ruby) end # Verify that the DLL dependencies are all allowed. - actual_imports = ldd.scan(/^\t([^ ]+) /).map(&:first).uniq + actual_imports = ldd.scan(/^\t([^ ]+) /).map(&:first).uniq.sort unless (actual_imports - allowed_imports).empty? raise "unallowed so imports #{actual_imports.inspect} in #{dll} (allowed #{allowed_imports.inspect})" end diff --git a/test/xml/test_document.rb b/test/xml/test_document.rb index 4008aefdbd..4e275273e0 100644 --- a/test/xml/test_document.rb +++ b/test/xml/test_document.rb @@ -264,6 +264,21 @@ def test_create_internal_subset assert_equal("staff.dtd", ss.system_id) end + def test_replacing_internal_subset + # see https://github.com/rgrove/sanitize/pull/238 + skip_unless_libxml2("JRuby impl does not support unlinking the internal subset, it probably should") + + document = Nokogiri::HTML5::Document.parse("
hello
") + + assert_equal("foo", document.internal_subset.name) + + document.internal_subset.unlink + document.create_internal_subset("bar", nil, nil) + + assert_equal("bar", document.internal_subset.name) + assert_operator(document.to_html, :start_with?, "") + end + def test_external_subset assert_nil(xml.external_subset) xml = Dir.chdir(ASSETS_DIR) do