1.14.0 / 2023-01-12 #2760
flavorjones
announced in
Releases
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
1.14.0 / 2023-01-12
Notable Changes
Ruby
This release introduces native gem support for Ruby 3.2. (Also see "Technical note" under "Changed" below.)
This release ends support for:
Faster, more reliable installation: Native Gem for
aarch64-linux
(akalinux/arm64/v8
)This version of Nokogiri ships official native gem support for the
aarch64-linux
platform, which should support AWS Graviton and other ARM64 Linux platforms. Please note that glibc >= 2.29 is required for aarch64-linux systems, see Supported Platforms for more information.Faster, more reliable installation: Native Gem for
arm-linux
(akalinux/arm/v7
)This version of Nokogiri ships experimental native gem support for the
arm-linux
platform. Please note that glibc >= 2.29 is required for arm-linux systems, see Supported Platforms for more information.Pattern matching
This version introduces an experimental pattern matching API for
XML::Attr
,XML::Document
,XML::DocumentFragment
,XML::Namespace
,XML::Node
, andXML::NodeSet
(and their subclasses).Some documentation on what can be matched:
XML::Attr#deconstruct_keys
XML::Document#deconstruct_keys
XML::Namespace#deconstruct_keys
XML::Node#deconstruct_keys
XML::DocumentFragment#deconstruct
XML::NodeSet#deconstruct
We welcome feedback on this API at #2360.
Dependencies
CRuby
JRuby
jar-dependencies
to manage most of the vendored Java dependencies.nokogiri -v
now outputs maven metadata for all Java dependencies, andNokogiri::VERSION_INFO
also contains this metadata. [#2432]net.sourceforge.htmlunit:neko-htmlunit:2.61.0
(previously Nokogiri used a fork oforg.cyberneko.html:nekohtml
)com.thaiopensource:jing:20091111
tonu.validator:jing:20200702VNU
.net.sf.saxon:Saxon-HE:9.6.0-4
(vianu.validator:jing:20200702VNU
).Added
Node#wrap
andNodeSet#wrap
now also accept aNode
type argument, which will bedup
ed for each wrapper. For cases where many nodes are being wrapped, creating aNode
once usingDocument#create_element
and passing thatNode
multiple times is significantly faster than re-parsing markup on each call. [#2657]nokogiri
namespace prefix. Historically, the JRuby implementation required this namespace but the CRuby implementation did not support it. It's recommended that all XPath and CSS queries use thenokogiri
namespace going forward. Invocation without the namespace is planned for deprecation in v1.15.0 and removal in a future release. [#2147]HTML5::Document#quirks_mode
andHTML5::DocumentFragment#quirks_mode
expose the quirks mode used by the parser.Improved
Functional
Performance
Encoding
objects rather than compare their names. This is a slight performance improvement and is future-proof. [#2454] (Thanks, @casperisfine!)Error handling
Document#canonicalize
now raises an exception ifinclusive_namespaces
is non-nil and the mode is inclusive, i.e.XML_C14N_1_0
orXML_C14N_1_1
.inclusive_namespaces
can only be passed with exclusive modes, and previously this silently failed.Nokogiri::CSS::SyntaxError
message, "empty CSS selector". Previously the exception raised from the bowels ofracc
was "unexpected '$' after ''". [#2700]XML::Reader
parsing errors encountered duringReader#attribute_hash
andReader#namespaces
now raise anXML::SyntaxError
. Previously these methods would returnnil
and users would generally experienceNoMethodErrors
from elsewhere in the code.ruby_xmalloc
tomalloc
within the C extension. [#2480] (Thanks, @Garfield96!)Installation
gumbo.h
on OpenBSD. [#2464]vasprintf
in favor of platform-independentrb_vsprintf
-Wno-unknown-warning-option
to avoid errors when Ruby injects options that clang doesn't know about. [#2689]Fixed
SAX::Parser
'sencoding
attribute will not be clobbered when an alternative encoding is passed intoSAX::Parser#parse_io
. [#1942] (Thanks, @kp666!)HTML4::DocumentFragment
will now be properly encoded. Previously this empty string was encoded asUS-ASCII
. [#2649]Node#wrap
now uses the parent as the context node for parsing wrapper markup, falling back to the document for unparented nodes. Previously the document was always used.form
elements.HTML5::Document#fragment
now always usesbody
as the parsing context. Previously, fragments were parsed in the context of the associated document's root node, which allowed for inconsistent parsing. [#2553]Nokogiri::HTML5::Document#url
now correctly returns the URL passed to the constructor method. Previously it always returnednil
. [#2583]HTML5
encoding detection is now case-insensitive with respect tometa
tag charset declaration. [#2693]HTML5
fragment parsing in context of an annotation-xml node now works. Previously this rarely-used path invoked rb_funcall with incorrect parameters, resulting in an exception, a fatal error, or potentially a segfault. [#2692]HTML5
quirks mode during fragment parsing more closely matches document parsing. [#2646]#add_namespace_definition
. [#1247]NodeSet#[]
now raises a TypeError if passed an invalid parameter type. [#2211]Deprecated
Nokogiri.install_default_aliases
is deprecated in favor ofNokogiri::EncodingHandler.install_default_aliases
. This is part of a private API and is probably not called by anybody, but we'll go through a deprecation cycle before removal anyway. [#2643, #2446]Changed
Thank you!
The following people and organizations were kind enough to sponsor @flavorjones or the Nokogiri project during the development of v1.14.0:
sha256 checksums:
This discussion was created from the release 1.14.0 / 2023-01-12.
Beta Was this translation helpful? Give feedback.
All reactions