[ANN] nokogiri v1.12.0 released

Nokogiri v1.12.0 has been released!

This is a feature update focused on HTML5 DOM parser support.

···

---

Nokogiri <https://nokogiri.org/> (鋸) makes it easy and painless to work
with XML and HTML from Ruby. It provides a sensible, easy-to-understand API
for reading
<Parsing an HTML/XML document - Nokogiri>,
writing, modifying
<Modifying an HTML/XML document - Nokogiri>, and
querying <Searching a XML/HTML document - Nokogiri>
documents.
It is fast and standards-compliant by relying on native parsers like
libxml2 (C) and xerces (Java).

---

1.12.0 / 2021-08-02Notable Addition: HTML5 Support (CRuby only)

*HTML5 support* has been added (to CRuby only) by merging Nokogumbo
<GitHub - rubys/nokogumbo: A Nokogiri interface to the Gumbo HTML5 parser.> into Nokogiri. The Nokogumbo public
API has been preserved, so this functionality is available under the
Nokogiri::HTML5 namespace. [#2204
<Epic: merge Nokogumbo into Nokogiri · Issue #2204 · sparklemotion/nokogiri · GitHub>]

Please note that HTML5 support is not available for JRuby in this version.
However, we feel it is important to think about JRuby and we hope to work
on this in the future. If you're interested in helping with HTML5 support
on JRuby, please reach out to the maintainers by commenting on issue #2227
<[feature request] HTML5 parser for JRuby implementation · Issue #2227 · sparklemotion/nokogiri · GitHub>.

Many thanks to Sam Ruby, Steve Checkoway, and Craig Barnes for creating and
maintaining Nokogumbo and supporting the Gumbo HTML5 parser. They're now
Nokogiri core contributors with all the powers and privileges pertaining
thereto. :raised_hands:
Notable Change: Nokogiri::HTML4 module and namespace

Nokogiri::HTML has been renamed to Nokogiri::HTML4, and Nokogiri::HTML is
aliased to preserve backwards-compatibility. Nokogiri::HTML and
Nokogiri::HTML4 parse methods still use libxml2's (or NekoHTML's) HTML4
parser in the v1.12 release series.

Take special note that if you rely on the class name of an object in your
code, objects will now report a class of Nokogiri::HTML4::Foo where they
previously reported Nokogiri::HTML::Foo. Instead of relying on the string
returned by Object#class, prefer Class#=== or Object#is_a? or
Object#instance_of?.

Future releases of Nokogiri may deprecate HTML methods or otherwise change
this behavior, so please start using HTML4 in place of HTML.
Added

   - [CRuby] Nokogiri::VERSION_INFO["libxslt"]["datetime_enabled"] is a new
   boolean value which describes whether libxslt (or, more properly, libexslt)
   has compiled-in datetime support. This generally going to be true, but
   some distros ship without this support (e.g., some mingw UCRT-based
   packages, see libxslt: Fix build failure and date/time issue in libxslt by larskanis · Pull Request #8957 · msys2/MINGW-packages · GitHub). See
   #2272 <ci: try UCRT for windows ruby-head builds by flavorjones · Pull Request #2272 · sparklemotion/nokogiri · GitHub> for more
   details.

Changed

   - Introduce a new constant, Nokogiri::XML::ParseOptions::DEFAULT_XSLT,
   which adds the libxslt-preferred options of NOENT | DTDLOAD | DTDATTR |
   NOCDATA to ParseOptions::DEFAULT_XML.
   - Nokogiri.XSLT parses stylesheets using ParseOptions::DEFAULT_XSLT,
   which should make some edge-case XSL transformations match libxslt's
   default behavior. [#1940
   <parse XSLT::Stylesheet using the libxslt-preferred options · Issue #1940 · sparklemotion/nokogiri · GitHub>]

Fixed

   - [CRuby] Namespaced attributes are handled properly when their parent
   node is reparented into another document. Previously, the namespace may
   have gotten dropped. [#2228
   <[bug] When copying between documents nokogiri strips attribute namespace if it differs from tag's · Issue #2228 · sparklemotion/nokogiri · GitHub>]
   - [CRuby] Reparented nodes no longer inherit their parent's namespace.
   Previously, a node without a namespace was forced to adopt its parent's
   namespace. [#1712 <XML::Builder behaves strangely with respect to namespaces · Issue #1712 · sparklemotion/nokogiri · GitHub>
   ]

Improved

   - [CRuby] Speed up (slightly) the compile time of packaged libraries
   libiconv, libxml2, and libxslt by using autoconf's
   --disable-dependency-tracking option. ("ruby" platform gem only.)

Deprecated

   - Deprecating Nokogumbo's Nokogiri::HTML5.get. This method will be
   removed in a future version of Nokogiri.

Dependencies

   - [CRuby] Upgrade mini_portile2 dependency from ~> 2.5.0 to ~> 2.6.1.
   ("ruby" platform gem only.)