Nokogiri (鋸) is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support.

Overview

Nokogiri

Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is fast and standards-compliant by relying on native parsers like libxml2 (C) and xerces (Java).

Guiding Principles

Some guiding principles Nokogiri tries to follow:

  • be secure-by-default by treating all documents as untrusted by default
  • be a thin-as-reasonable layer on top of the underlying parsers, and don't attempt to fix behavioral differences between the parsers

Features Overview

  • DOM Parser for XML and HTML4
  • SAX Parser for XML and HTML4
  • Push Parser for XML and HTML4
  • Document search via XPath 1.0
  • Document search via CSS3 selectors, with some jquery-like extensions
  • XSD Schema validation
  • XSLT transformation
  • "Builder" DSL for XML and HTML documents

Status

Concourse CI Appveyor CI Code Climate Test Coverage

Gem Version SemVer compatibility Tidelift dependencies

Support, Getting Help, and Reporting Issues

All official documentation is posted at https://nokogiri.org (the source for which is at https://github.com/sparklemotion/nokogiri.org/, and we welcome contributions).

Consider subscribing to Tidelift which provides license assurances and timely security notifications for your open source dependencies, including Nokogiri. Tidelift subscriptions also help the Nokogiri maintainers fund our automated testing which in turn allows us to ship releases, bugfixes, and security updates more often.

Reading

Your first stops for learning more about Nokogiri should be:

Ask For Help

There are a few ways to ask exploratory questions:

Please do not mail the maintainers at their personal addresses.

Report A Bug

The Nokogiri bug tracker is at https://github.com/sparklemotion/nokogiri/issues

Please use the "Bug Report" or "Installation Difficulties" templates.

Security and Vulnerability Reporting

Please report vulnerabilities at https://hackerone.com/nokogiri

Full information and description of our security policy is in SECURITY.md

Semantic Versioning Policy

Nokogiri follows Semantic Versioning (since 2017 or so). Dependabot's SemVer compatibility score for Nokogiri

We bump Major.Minor.Patch versions following this guidance:

Major: (we've never done this)

  • Significant backwards-incompatible changes to the public API that would require rewriting existing application code.
  • Some examples of backwards-incompatible changes we might someday consider for a Major release are at ROADMAP.md.

Minor:

Patch:

  • Bugfixes.
  • Security updates.
  • Updating packaged libraries for security-related reasons.

Installation

Requirements:

  • Ruby >= 2.5
  • JRuby >= 9.2.0.0

Native Gems: Faster, more reliable installation

"Native gems" contain pre-compiled libraries for a specific machine architecture. On supported platforms, this removes the need for compiling the C extension and the packaged libraries, or for system dependencies to exist. This results in much faster installation and more reliable installation, which as you probably know are the biggest headaches for Nokogiri users.

Supported Platforms

As of v1.11.0, Nokogiri ships pre-compiled, "native" gems for the following platforms:

  • Linux: x86-linux and x86_64-linux (req: glibc >= 2.17), including musl platforms like Alpine
  • Darwin/MacOS: x86_64-darwin and arm64-darwin
  • Windows: x86-mingw32 and x64-mingw32
  • Java: any platform running JRuby 9.2 or higher

To determine whether your system supports one of these gems, look at the output of bundle platform or ruby -e 'puts Gem::Platform.local.to_s'.

If you're on a supported platform, either gem install or bundle install should install a native gem without any additional action on your part. This installation should only take a few seconds, and your output should look something like:

$ gem install nokogiri
Fetching nokogiri-1.11.0-x86_64-linux.gem
Successfully installed nokogiri-1.11.0-x86_64-linux
1 gem installed

Other Installation Options

Because Nokogiri is a C extension, it requires that you have a C compiler toolchain, Ruby development header files, and some system dependencies installed.

The following may work for you if you have an appropriately-configured system:

gem install nokogiri

If you have any issues, please visit Installing Nokogiri for more complete instructions and troubleshooting.

How To Use Nokogiri

Nokogiri is a large library, and so it's challenging to briefly summarize it. We've tried to provide long, real-world examples at Tutorials.

Parsing and Querying

Here is example usage for parsing and querying a document:

#! /usr/bin/env ruby

require 'nokogiri'
require 'open-uri'

# Fetch and parse HTML document
doc = Nokogiri::HTML(URI.open('https://nokogiri.org/tutorials/installing_nokogiri.html'))

# Search for nodes by css
doc.css('nav ul.menu li a', 'article h2').each do |link|
  puts link.content
end

# Search for nodes by xpath
doc.xpath('//nav//ul//li/a', '//article//h2').each do |link|
  puts link.content
end

# Or mix and match
doc.search('nav ul.menu li a', '//article//h2').each do |link|
  puts link.content
end

Encoding

Strings are always stored as UTF-8 internally. Methods that return text values will always return UTF-8 encoded strings. Methods that return a string containing markup (like to_xml, to_html and inner_html) will return a string encoded like the source document.

WARNING

Some documents declare one encoding, but actually use a different one. In these cases, which encoding should the parser choose?

Data is just a stream of bytes. Humans add meaning to that stream. Any particular set of bytes could be valid characters in multiple encodings, so detecting encoding with 100% accuracy is not possible. libxml2 does its best, but it can't be right all the time.

If you want Nokogiri to handle the document encoding properly, your best bet is to explicitly set the encoding. Here is an example of explicitly setting the encoding to EUC-JP on the parser:

  doc = Nokogiri.XML('<foo><bar /></foo>', nil, 'EUC-JP')

Technical Overview

Guiding Principles

As noted above, two guiding principles of the software are:

  • be secure-by-default by treating all documents as untrusted by default
  • be a thin-as-reasonable layer on top of the underlying parsers, and don't attempt to fix behavioral differences between the parsers

Notably, despite all parsers being standards-compliant, there are behavioral inconsistencies between the parsers used in the CRuby and JRuby implementations, and Nokogiri does not and should not attempt to remove these inconsistencies. Instead, we surface these differences in the test suite when they are important/semantic; or we intentionally write tests to depend only on the important/semantic bits (omitting whitespace from regex matchers on results, for example).

CRuby

The Ruby (a.k.a., CRuby, MRI, YARV) implementation is a C extension that depends on libxml2 and libxslt (which in turn depend on zlib and possibly libiconv).

These dependencies are met by default by Nokogiri's packaged versions of the libxml2 and libxslt source code, but a configuration option --use-system-libraries is provided to allow specification of alternative library locations. See Installing Nokogiri for full documentation.

We provide native gems by pre-compiling libxml2 and libxslt (and potentially zlib and libiconv) and packaging them into the gem file. In this case, no compilation is necessary at installation time, which leads to faster and more reliable installation.

See LICENSE-DEPENDENCIES.md for more information on which dependencies are provided in which native and source gems.

JRuby

The Java (a.k.a. JRuby) implementation is a Java extension that depends primarily on Xerces and NekoHTML for parsing, though additional dependencies are on isorelax, nekodtd, jing, serializer, xalan-j, and xml-apis.

These dependencies are provided by pre-compiled jar files packaged in the java platform gem.

See LICENSE-DEPENDENCIES.md for more information on which dependencies are provided in which native and source gems.

Contributing

See CONTRIBUTING.md for an intro guide to developing Nokogiri.

Code of Conduct

We've adopted the Contributor Covenant code of conduct, which you can read in full in CODE_OF_CONDUCT.md.

License

This project is licensed under the terms of the MIT license.

See this license at LICENSE.md.

Dependencies

Some additional libraries may be distributed with your version of Nokogiri. Please see LICENSE-DEPENDENCIES.md for a discussion of the variations as well as the licenses thereof.

Authors

  • Mike Dalessio
  • Aaron Patterson
  • Yoko Harada
  • Akinori MUSHA
  • John Shahid
  • Karol Bucek
  • Lars Kanis
  • Sergio Arbeo
  • Timothy Elliott
  • Nobuyoshi Nakada
Comments
  • libiconv is missing

    libiconv is missing

    We're running Ruby 1.8.7 (through RVM) on OS X 10.6.6. Trying to install nokogiri 1.4.4 using bundler results always the following error:

    Installing nokogiri (1.4.4) with native extensions /Users/administrator/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/installer.rb:533:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
    
    /Users/administrator/.rvm/rubies/ruby-1.8.7-p302/bin/ruby extconf.rb 
    checking for libxml/parser.h... yes
    checking for libxslt/xslt.h... yes
    checking for libexslt/exslt.h... yes
    checking for iconv_open() in iconv.h... no
    checking for iconv_open() in -liconv... no
    -----
    libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
    -----
    *** extconf.rb failed ***
    […]
    

    Following the instructions here in the wiki as well as around the net we've used MacPorts to install libxml2 and libxslt, which results in the following situation:

    sudo port install libxml2 libxslt
    Password:
    Error: Cannot install libxml2 for the arch(s) 'x86_64' because
    Error: its dependency libiconv is only installed for the archs 'i386 ppc'.
    Error: Unable to execute port: architecture mismatch
    

    We've build libxml2 and libxslt from source and tried both to install the gem with the flags for the MacPorts and the build as described in the wiki as well as a few variations found online. — The results remains the same. We've even downloaded the gem, changed extconf.rb as suggested here: https://github.com/tenderlove/nokogiri/issues#issue/381, and compiled it locally but the final outcome is the same.

    What are we missing? We're pretty much stuck with this situation.

    opened by polarblau 109
  • Support Ruby x64 on Windows

    Support Ruby x64 on Windows

    With Ruby 2.0 release there's now Ruby x64 available for Windows. Also DevKit have been released with MinGW x64. Most of typical gems does build fine with it. http://rubyinstaller.org/downloads/

    opened by davispuh 108
  • Nokogiri error: Libiconv missing on mavericks

    Nokogiri error: Libiconv missing on mavericks

    I am trying to install nokogiri on maverick and i am unable to do so, even when libiconv is installed through brew:

    • Here is the log
    Installing nokogiri (1.6.2.1) Building nokogiri using packaged libraries.
    
    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    
        /usr/local/rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
    Building nokogiri using packaged libraries.
    checking for iconv.h... yes
    checking for iconv_open() in iconv.h... no
    checking for iconv_open() in -liconv... no
    checking for libiconv_open() in iconv.h... no
    checking for libiconv_open() in -liconv... no
    -----
    libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
    -----
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers.  Check the mkmf.log file for more details.  You may
    need configuration options.
    
    Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/rvm/rubies/ruby-2.0.0-p0/bin/ruby
        --help
        --clean
        --use-system-libraries
        --enable-static
        --disable-static
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --enable-cross-build
        --disable-cross-build
    
    
    Gem files will remain installed in /Users/Jaffery/Desktop/helpspree/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.2.1 for inspection.
    Results logged to /Users/Jaffery/Desktop/helpspree/vendor/bundle/ruby/2.0.0/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out
    
    An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.
    Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.
    
    opened by Jaffery5 60
  • Compile issue on OS X Mavericks 10.9.5

    Compile issue on OS X Mavericks 10.9.5

    Despite saying that it's using a special bundled libxml2, the process fails to find it. Here is the interesting excerpt from ~/.rvm/gems/ruby-2.1.2@my_service/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.5/mkmf.log. Suspicious lines (there is no "travis" user on my system):

    ld: warning: directory not found for option '-L/Users/travis/.sm/pkg/active/lib'
    ld: library not found for -llibxml2
    
    conftest.c:15:27: error: too few arguments to function call, single argument 'cur' was not specified
    int t(void) { xmlParseDoc(); return 0; }
                  ~~~~~~~~~~~ ^
    /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/include/libxml2/libxml/parser.h:841:11: note: 'xmlParseDoc' declared here
    XMLPUBFUN xmlDocPtr XMLCALL
              ^
    
    have_library: checking for xmlParseDoc() in -llibxml2... -------------------- no
    
    "gcc -o conftest -I/Users/bruce/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/bruce/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/bruce/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -I/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/include -I/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/include/libxml2 -I/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_LIBXML2_PATH\=\"/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2\" -DNOKOGIRI_LIBXML2_PATCHES\=\"0001-Revert-Missing-initialization-for-the-catalog-module.patch\ 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch\" -DNOKOGIRI_LIBXSLT_PATH\=\"/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28\" -DNOKOGIRI_LIBXSLT_PATCHES\=\"0001-Adding-doc-update-related-to-1.1.28.patch\ 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch\ 0003-Initialize-pseudo-random-number-generator-with-curre.patch\ 0004-EXSLT-function-str-replace-is-broken-as-is.patch\ 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch\ 0007-Separate-function-for-predicate-matching-in-patterns.patch\ 0008-Fix-direct-pattern-matching.patch\ 0009-Fix-certain-patterns-with-predicates.patch\ 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch\ 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch\ 0014-Fix-for-bug-436589.patch\ 0015-Fix-mkdir-for-mingw.patch\" -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.6 -pipe  -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c  -L. -L/Users/bruce/.rvm/rubies/ruby-2.1.2/lib -L/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib -L/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib -L. -L/Users/travis/.sm/pkg/active/lib -fPIC -Bstatic -fstack-protector   -arch x86_64  /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libexslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libxslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a -llzma -lruby-static -framework CoreFoundation -llibxml2 /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libexslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libxslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a -llzma -lpthread -ldl -lobjc  "
    ld: warning: directory not found for option '-L/Users/travis/.sm/pkg/active/lib'
    ld: library not found for -llibxml2
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    checked program was:
    /* begin */
     1: #include "ruby.h"
     2: 
     3: #include <libxml/parser.h>
     4: 
     5: /*top*/
     6: extern int t(void);
     7: int main(int argc, char **argv)
     8: {
     9:   if (argc > 1000000) {
    10:     printf("%p", &t);
    11:   }
    12: 
    13:   return 0;
    14: }
    15: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlParseDoc; return 0; }
    /* end */
    
    "gcc -o conftest -I/Users/bruce/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/bruce/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/bruce/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -I/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/include -I/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/include/libxml2 -I/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -DNOKOGIRI_LIBXML2_PATH\=\"/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2\" -DNOKOGIRI_LIBXML2_PATCHES\=\"0001-Revert-Missing-initialization-for-the-catalog-module.patch\ 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch\" -DNOKOGIRI_LIBXSLT_PATH\=\"/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28\" -DNOKOGIRI_LIBXSLT_PATCHES\=\"0001-Adding-doc-update-related-to-1.1.28.patch\ 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch\ 0003-Initialize-pseudo-random-number-generator-with-curre.patch\ 0004-EXSLT-function-str-replace-is-broken-as-is.patch\ 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch\ 0007-Separate-function-for-predicate-matching-in-patterns.patch\ 0008-Fix-direct-pattern-matching.patch\ 0009-Fix-certain-patterns-with-predicates.patch\ 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch\ 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch\ 0014-Fix-for-bug-436589.patch\ 0015-Fix-mkdir-for-mingw.patch\" -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.6 -pipe  -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c  -L. -L/Users/bruce/.rvm/rubies/ruby-2.1.2/lib -L/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib -L/Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib -L. -L/Users/travis/.sm/pkg/active/lib -fPIC -Bstatic -fstack-protector   -arch x86_64  /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libexslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libxslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a -llzma -lruby-static -framework CoreFoundation -llibxml2 /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libexslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.28/lib/libxslt.a -lm -liconv -lpthread -lz /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/lib/libxml2.a -llzma -lpthread -ldl -lobjc  "
    conftest.c:15:27: error: too few arguments to function call, single argument 'cur' was not specified
    int t(void) { xmlParseDoc(); return 0; }
                  ~~~~~~~~~~~ ^
    /Users/bruce/.rvm/gems/ruby-2.1.2@my_service/gems/nokogiri-1.6.5/ports/x86_64-apple-darwin13.1.0/libxml2/2.9.2/include/libxml2/libxml/parser.h:841:11: note: 'xmlParseDoc' declared here
    XMLPUBFUN xmlDocPtr XMLCALL
              ^
    1 error generated.
    checked program was:
    /* begin */
     1: #include "ruby.h"
     2: 
     3: #include <libxml/parser.h>
     4: 
     5: /*top*/
     6: extern int t(void);
     7: int main(int argc, char **argv)
     8: {
     9:   if (argc > 1000000) {
    10:     printf("%p", &t);
    11:   }
    12: 
    13:   return 0;
    14: }
    15: int t(void) { xmlParseDoc(); return 0; }
    /* end */
    
    --------------------
    
    platform/osx 
    opened by baburdick 58
  • Nokogiri 1.6.8 Install Fails on Mac OS X with xz installed from Homebrew

    Nokogiri 1.6.8 Install Fails on Mac OS X with xz installed from Homebrew

    Action:

    brew install xz
    gem install nokogiri -v 1.6.8
    

    Expected:

    Nokogiri 1.6.8 installs correctly.

    Actual:

    Restoring gems to pristine condition...
    Building native extensions.  This could take a while...
    ERROR:  While executing gem ... (Gem::Ext::BuildError)
        ERROR: Failed to build gem native extension.
    
        current directory: /Users/austin/.gem/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri
    /Users/austin/.rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160607-71935-1m9be2b.rb extconf.rb
    Using pkg-config version 1.1.7
    checking if the C compiler accepts ... yes
    checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
    Building nokogiri using packaged libraries.
    Using mini_portile version 2.1.0
    checking for iconv.h... yes
    checking for gzdopen() in -lz... yes
    checking for iconv... yes
    ************************************************************************
    IMPORTANT NOTICE:
    
    Building Nokogiri with a packaged version of libxml2-2.9.4.
    
    Team Nokogiri will keep on doing their best to provide security
    updates in a timely manner, but if this is a concern for you and want
    to use the system library instead; abort this installation process and
    reinstall nokogiri as follows:
    
        gem install nokogiri -- --use-system-libraries
            [--with-xml2-config=/path/to/xml2-config]
            [--with-xslt-config=/path/to/xslt-config]
    
    If you are using Bundler, tell it to use the option:
    
        bundle config build.nokogiri --use-system-libraries
        bundle install
    
    Note, however, that nokogiri is not fully compatible with arbitrary
    versions of libxml2 provided by OS/package vendors.
    ************************************************************************
    Extracting libxml2-2.9.4.tar.gz into tmp/x86_64-apple-darwin15.3.0/ports/libxml2/2.9.4... OK
    Running 'configure' for libxml2 2.9.4... OK
    Running 'compile' for libxml2 2.9.4... ERROR, review '/Users/austin/.gem/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri/tmp/x86_64-apple-darwin15.3.0/ports/libxml2/2.9.4/compile.log' to see what happened. Last lines are:
    ========================================================================
        unsigned short* in = (unsigned short*) inb;
                             ^~~~~~~~~~~~~~~~~~~~~
    encoding.c:815:27: warning: cast from 'unsigned char *' to 'unsigned short *' increases required alignment from 1 to 2 [-Wcast-align]
        unsigned short* out = (unsigned short*) outb;
                              ^~~~~~~~~~~~~~~~~~~~~~
    4 warnings generated.
      CC       error.lo
      CC       parserInternals.lo
      CC       parser.lo
      CC       tree.lo
      CC       hash.lo
      CC       list.lo
      CC       xmlIO.lo
    xmlIO.c:1450:52: error: use of undeclared identifier 'LZMA_OK'
        ret =  (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1;
                                                       ^
    1 error generated.
    make[2]: *** [xmlIO.lo] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    ========================================================================
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers.  Check the mkmf.log file for more details.  You may
    need configuration options.
    
    Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/Users/austin/.rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
        --help
        --clean
        --use-system-libraries
        --enable-static
        --disable-static
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --enable-cross-build
        --disable-cross-build
    /Users/austin/.gem/ruby/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:366:in `block in execute': Failed to complete compile task (RuntimeError)
        from /Users/austin/.gem/ruby/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `chdir'
        from /Users/austin/.gem/ruby/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `execute'
        from /Users/austin/.gem/ruby/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:111:in `compile'
        from /Users/austin/.gem/ruby/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:150:in `cook'
        from extconf.rb:364:in `block (2 levels) in process_recipe'
        from extconf.rb:257:in `block in chdir_for_build'
        from extconf.rb:256:in `chdir'
        from extconf.rb:256:in `chdir_for_build'
        from extconf.rb:363:in `block in process_recipe'
        from extconf.rb:262:in `tap'
        from extconf.rb:262:in `process_recipe'
        from extconf.rb:555:in `<main>'
    
    To see why this extension failed to compile, please check the mkmf.log which can be found here:
    
      /Users/austin/.gem/ruby/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/nokogiri-1.6.8/mkmf.log
    
    extconf failed, exit code 1
    
    Gem files will remain installed in /Users/austin/.gem/ruby/2.3.0/gems/nokogiri-1.6.8 for inspection.
    Results logged to /Users/austin/.gem/ruby/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/nokogiri-1.6.8/gem_make.out
    gem pristine nokogiri -v 1.6.8  9.23s user 7.56s system 92% cpu 18.089 total
    

    When I do:

    brew uninstall xz
    gem install nokogiri -v 1.6.8
    

    Nokogiri 1.6.8 installs correctly.

    opened by halostatue 51
  • LoadError when deploying to JRuby/Torquebox on Windows

    LoadError when deploying to JRuby/Torquebox on Windows

    Ruby: JRuby 1.7.11 Rails: 4.0.5 Nokogiri: 1.6.2.1 OS: Windows 2008 Server (64bit) Torquebox: 1.3.1 Java: 1.7.0_40-b43

    Starting the rails-app gives me:

    (LoadError) load error: nokogiri/nokogiri -- java.lang.NoClassDefFoundError: com/sun/org/apache/xpath/internal/VariableStack
    

    Older versions of Nokogiri (tried it with 1.5.11) work.

    platform/jruby 
    opened by fpauser 49
  • Seg Faults and Bus Errors with 1.2.3 but not with 1.2.2

    Seg Faults and Bus Errors with 1.2.3 but not with 1.2.2

    I haven't worked out a way to create a simple example of this, but when I tried to use webrat (which requires nokogiri) I found that my existing tests (about 10 test classes run from rake test:integration) when run together (not singly) caused a seg fault or a bus error (this was before I wrote any specific webrat tests).

    So as far as I understand Nokogiri shouldn't even be being called. And when I could deduce where the error occurred it was somewhere deep in the rails framework (but suspiciously in an html parsing context). I tried step-debugging the code, but this gave me an error in a different place.

    Running on a OSX 10.5.6, Ruby 1.8.6

    My workaround was to downgrade nokogiri to 1.2.2

    Sorry this wasn't such a useful issue, but maybe you can give me some guidance as to what information could help narrow down the possible cause.

    topic/libxml-ruby 
    opened by timdiggins 45
  • OSX install problem (1.6.5, 1.6.6.2)

    OSX install problem (1.6.5, 1.6.6.2)

    ➔ uname -a
    Darwin johns-MBP 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
    ➔ rbenv version
    2.1.5 (set by /Users/john/.rbenv/version)
    ➔ gem install nokogiri -v '1.6.6.1'
    Fetching: nokogiri-1.6.6.1.gem (100%)
    Building native extensions.  This could take a while...
    ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.
    
        /Users/john/.rbenv/versions/2.1.5/bin/ruby extconf.rb
    checking if the C compiler accepts ... yes
    checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... yes
    Building nokogiri using packaged libraries.
    checking for gzdopen() in -lz... yes
    checking for iconv... yes
    ************************************************************************
    IMPORTANT NOTICE:
    
    Building Nokogiri with a packaged version of libxml2-2.9.2
    with the following patches applied:
        - 0001-Revert-Missing-initialization-for-the-catalog-module.patch
        - 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch
    
    Team Nokogiri will keep on doing their best to provide security
    updates in a timely manner, but if this is a concern for you and want
    to use the system library instead; abort this installation process and
    reinstall nokogiri as follows:
    
        gem install nokogiri -- --use-system-libraries
            [--with-xml2-config=/path/to/xml2-config]
            [--with-xslt-config=/path/to/xslt-config]
    
    If you are using Bundler, tell it to use the option:
    
        bundle config build.nokogiri --use-system-libraries
        bundle install
    
    Note, however, that nokogiri is not fully compatible with arbitrary
    versions of libxml2 provided by OS/package vendors.
    ************************************************************************
    Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-apple-darwin14.0.0/ports/libxml2/2.9.2... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch...
    Running 'patch' for libxml2 2.9.2... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxml2/0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch...
    Running 'patch' for libxml2 2.9.2... OK
    Running 'configure' for libxml2 2.9.2... OK
    Running 'compile' for libxml2 2.9.2... OK
    Running 'install' for libxml2 2.9.2... OK
    Activating libxml2 2.9.2 (from /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/x86_64-apple-darwin14.0.0/libxml2/2.9.2)...
    ************************************************************************
    IMPORTANT NOTICE:
    
    Building Nokogiri with a packaged version of libxslt-1.1.28
    with the following patches applied:
        - 0001-Adding-doc-update-related-to-1.1.28.patch
        - 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch
        - 0003-Initialize-pseudo-random-number-generator-with-curre.patch
        - 0004-EXSLT-function-str-replace-is-broken-as-is.patch
        - 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch
        - 0007-Separate-function-for-predicate-matching-in-patterns.patch
        - 0008-Fix-direct-pattern-matching.patch
        - 0009-Fix-certain-patterns-with-predicates.patch
        - 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch
        - 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch
        - 0014-Fix-for-bug-436589.patch
        - 0015-Fix-mkdir-for-mingw.patch
    
    Team Nokogiri will keep on doing their best to provide security
    updates in a timely manner, but if this is a concern for you and want
    to use the system library instead; abort this installation process and
    reinstall nokogiri as follows:
    
        gem install nokogiri -- --use-system-libraries
            [--with-xml2-config=/path/to/xml2-config]
            [--with-xslt-config=/path/to/xslt-config]
    
    If you are using Bundler, tell it to use the option:
    
        bundle config build.nokogiri --use-system-libraries
        bundle install
    ************************************************************************
    Extracting libxslt-1.1.28.tar.gz into tmp/x86_64-apple-darwin14.0.0/ports/libxslt/1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0001-Adding-doc-update-related-to-1.1.28.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0003-Initialize-pseudo-random-number-generator-with-curre.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0004-EXSLT-function-str-replace-is-broken-as-is.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0006-Fix-str-padding-to-work-with-UTF-8-strings.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0007-Separate-function-for-predicate-matching-in-patterns.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0008-Fix-direct-pattern-matching.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0009-Fix-certain-patterns-with-predicates.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0014-Fix-for-bug-436589.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running patch with /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/patches/libxslt/0015-Fix-mkdir-for-mingw.patch...
    Running 'patch' for libxslt 1.1.28... OK
    Running 'configure' for libxslt 1.1.28... OK
    Running 'compile' for libxslt 1.1.28... OK
    Running 'install' for libxslt 1.1.28... OK
    Activating libxslt 1.1.28 (from /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1/ports/x86_64-apple-darwin14.0.0/libxslt/1.1.28)...
    checking for main() in -llzma... yes
    checking for xmlParseDoc() in libxml/parser.h... no
    checking for xmlParseDoc() in -lxml2... no
    checking for xmlParseDoc() in -llibxml2... no
    -----
    libxml2 is missing.  Please locate mkmf.log to investigate how it is failing.
    -----
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers.  Check the mkmf.log file for more details.  You may
    need configuration options.
    
    Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/Users/john/.rbenv/versions/2.1.5/bin/ruby
        --help
        --clean
        --use-system-libraries
        --enable-static
        --disable-static
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --enable-cross-build
        --disable-cross-build
        --with-xml2lib
        --without-xml2lib
        --with-libxml2lib
        --without-libxml2lib
    
    extconf failed, exit code 1
    
    Gem files will remain installed in /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.6.1 for inspection.
    Results logged to /Users/john/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/nokogiri-1.6.6.1/gem_make.out
    
    platform/osx 
    opened by jjb 44
  • support for Windows native builds

    support for Windows native builds

    Something still isn't correct in your build tooling for windows as I get the following failure when building on a win8.1 64bit with mri 2.1.5 32bit using a 32bit mingw-w64 4.9.2 compiler.

    I know zlib easily builds on windows using the mingw-w64 toolchains because I do it all the time with helpers like this.

    From the last part of mkmf.log below (e.g. - missing -o conftest.exe, no lib info to gcc) I think you guys are sooooo close I can taste it :)

    C:\>uru ls
        17161       : jruby 1.7.16.1 (1.9.3p392) 2014-10-28 4e93f31 on Java HotSpot(TM...
        200p597-x32 : ruby 2.0.0p597 (2014-11-06 revision 48296) [i386-mingw32]
        215-test    : ruby 2.1.5p267 (2014-10-28 revision 48177) [i386-mingw32]
     => 215p272-x32 : ruby 2.1.5p272 (2014-11-06 revision 48303) [i386-mingw32]
    
    C:\>gem up nokogiri --platform=ruby
    Updating installed gems
    Updating nokogiri
    Fetching: nokogiri-1.6.4.1.gem (100%)
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing nokogiri:
            ERROR: Failed to build gem native extension.
    
        C:/Apps/rubies/ruby-2.1/bin/ruby.exe -r ./siteconf20141107-876-ixu5gn.rb extconf.rb
    checking if the C compiler accepts ... yes
    Building nokogiri using packaged libraries.
    ************************************************************************
    IMPORTANT NOTICE:
    
    Buidling Nokogiri with a packaged version of zlib-1.2.8.
    ...SNIP...
    Downloading zlib-1.2.8.tar.gz (100%)
    Extracting zlib-1.2.8.tar.gz into tmp/i686-pc-mingw32/ports/zlib/1.2.8... ERROR
    
    *** extconf.rb failed ***
    ...SNIP...
    C:/Apps/rubies/ruby-2.1/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.1/lib/mini_portile.rb:262:in `extract_file': Failed to complete extract task (RuntimeError)
            from C:/Apps/rubies/ruby-2.1/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.1/lib/mini_portile.rb:35:in `block in extract'
            from C:/Apps/rubies/ruby-2.1/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.1/lib/mini_portile.rb:33:in `each'
            from C:/Apps/rubies/ruby-2.1/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.1/lib/mini_portile.rb:33:in `extract'
            from C:/Apps/rubies/ruby-2.1/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.1/lib/mini_portile.rb:107:in `cook'
            from extconf.rb:268:in `block in process_recipe'
            from extconf.rb:167:in `tap'
            from extconf.rb:167:in `process_recipe'
            from extconf.rb:394:in `<main>'
    
    extconf failed, exit code 1
    

    And here's mkmf.log in it's entirety. The second test looks like the gcc command did not get generated correctly

    "gcc -o conftest.exe -IC:/Apps/rubies/ruby-2.1/include/ruby-2.1.0/i386-mingw32 -IC:/Apps/rubies/ruby-2.1/include/ruby-2.1.0/ruby/backward -IC:/Apps/rubies/ruby-2.1/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  conftest.c  -L. -LC:/Apps/rubies/ruby-2.1/lib -L.      -lmsvcrt-ruby210  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi   "
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <winsock2.h>
    4: #include <windows.h>
    5: int main(int argc, char **argv)
    6: {
    7:   return 0;
    8: }
    /* end */
    
    "gcc -IC:/Apps/rubies/ruby-2.1/include/ruby-2.1.0/i386-mingw32 -IC:/Apps/rubies/ruby-2.1/include/ruby-2.1.0/ruby/backward -IC:/Apps/rubies/ruby-2.1/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration    -Werror -c conftest.c"
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <winsock2.h>
    4: #include <windows.h>
    5: int main() {return 0;}
    /* end */
    
    platform/windows 
    opened by jonforums 43
  • Nokogiri 1.8.4 installation challenges on macOS Mojave

    Nokogiri 1.8.4 installation challenges on macOS Mojave

    If you're having trouble installing Nokogiri ...

    Have you tried following [the installation tutorial][tutorial]? yes

    What is the output of gem install?

    Building native extensions with: '--use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-xslt-dir=/usr/local/opt/libxml2'
    This could take a while...
    ERROR:  Error installing nokogiri:
    	ERROR: Failed to build gem native extension.
    
        current directory: ~/.gem/ruby/2.5.1/gems/nokogiri-1.8.4/ext/nokogiri
    ~/.rubies/ruby-2.5.1/bin/ruby -r ./siteconf20180926-34637-1628dkt.rb extconf.rb --use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-xslt-dir=/usr/local/opt/libxml2
    checking if the C compiler accepts ... yes
    checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
    Building nokogiri using system libraries.
    ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed.
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers.  Check the mkmf.log file for more details.  You may
    need configuration options.
    
    Provided configuration options:
    	--with-opt-dir
    	--without-opt-dir
    	--with-opt-include
    	--without-opt-include=${opt-dir}/include
    	--with-opt-lib
    	--without-opt-lib=${opt-dir}/lib
    	--with-make-prog
    	--without-make-prog
    	--srcdir=.
    	--curdir
    	--ruby=~/.rubies/ruby-2.5.1/bin/$(RUBY_BASE_NAME)
    	--help
    	--clean
    	--use-system-libraries=true
    	--with-zlib-dir
    	--without-zlib-dir
    	--with-zlib-include
    	--without-zlib-include=${zlib-dir}/include
    	--with-zlib-lib
    	--without-zlib-lib=${zlib-dir}/lib
    	--with-xml2-dir
    	--without-xml2-dir
    	--with-xml2-include
    	--without-xml2-include=${xml2-dir}/include
    	--with-xml2-lib
    	--without-xml2-lib=${xml2-dir}/lib
    	--with-libxml-2.0-config
    	--without-libxml-2.0-config
    	--with-pkg-config
    	--without-pkg-config
    	--with-xslt-dir
    	--with-xslt-include
    	--without-xslt-include=${xslt-dir}/include
    	--with-xslt-lib
    	--without-xslt-lib=${xslt-dir}/lib
    	--with-exslt-dir
    	--without-exslt-dir
    	--with-exslt-include
    	--without-exslt-include=${exslt-dir}/include
    	--with-exslt-lib
    	--without-exslt-lib=${exslt-dir}/lib
    	--with-libexslt-config
    	--without-libexslt-config
    
    To see why this extension failed to compile, please check the mkmf.log which can be found here:
    
      ~/.gem/ruby/2.5.1/extensions/x86_64-darwin-18/2.5.0-static/nokogiri-1.8.4/mkmf.log
    
    extconf failed, exit code 1
    
    Gem files will remain installed in ~/.gem/ruby/2.5.1/gems/nokogiri-1.8.4 for inspection.
    Results logged to ~/.gem/ruby/2.5.1/extensions/x86_64-darwin-18/2.5.0-static/nokogiri-1.8.4/gem_make.out
    

    What are the contents of the mkmf.log file?

    "clang -o conftest -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-darwin18 -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/backward -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0 -I. -I~/.rubies/ruby-2.5.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -O3 -Wno-error=shorten-64-to-32  -pipe  conftest.c  -L. -L~/.rubies/ruby-2.5.1/lib -L. -L~/.rubies/ruby-2.5.1/lib  -fstack-protector -L/usr/local/lib     -lruby.2.5.1-static -framework Foundation  -lpthread -lgmp -ldl -lobjc  "
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2:
    3: int main(int argc, char **argv)
    4: {
    5:   return 0;
    6: }
    /* end */
    
    "clang -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-darwin18 -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/backward -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0 -I. -I~/.rubies/ruby-2.5.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -O3 -Wno-error=shorten-64-to-32  -pipe    -Werror -c conftest.c"
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2:
    3: int main() {return 0;}
    /* end */
    
    "clang -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-darwin18 -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/backward -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0 -I. -I~/.rubies/ruby-2.5.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -O3 -Wno-error=shorten-64-to-32  -pipe  -Wno-error=unused-command-line-argument-hard-error-in-future   -Werror -c conftest.c"
    error: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Werror,-Wunknown-warning-option]
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2:
    3: int main() {return 0;}
    /* end */
    
    "pkg-config --exists libxml-2.0"
    | pkg-config --libs libxml-2.0
    => "-lxml2\n"
    "clang -o conftest -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-darwin18 -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/backward -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0 -I. -I~/.rubies/ruby-2.5.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -O3 -Wno-error=shorten-64-to-32  -pipe  conftest.c  -L. -L~/.rubies/ruby-2.5.1/lib -L. -L~/.rubies/ruby-2.5.1/lib  -fstack-protector -L/usr/local/lib     -lruby.2.5.1-static -framework Foundation -lxml2 -lpthread -lgmp -ldl -lobjc  "
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2:
    3: int main(int argc, char **argv)
    4: {
    5:   return 0;
    6: }
    /* end */
    
    | pkg-config --cflags-only-I libxml-2.0
    => "-I/usr/include/libxml2\n"
    | pkg-config --cflags-only-other libxml-2.0
    => "\n"
    | pkg-config --libs-only-l libxml-2.0
    => "-lxml2\n"
    package configuration for libxml-2.0
    cflags:
    ldflags:
    libs: -lxml2
    
    "pkg-config --exists libexslt"
    | pkg-config --libs libexslt
    => "-lexslt -lxslt -lxml2 -lz -lpthread -licucore -lm -lxml2\n"
    "clang -o conftest -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-darwin18 -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/backward -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0 -I. -I/usr/include/libxml2 -I/usr/local/opt/libxml2/include -I~/.rubies/ruby-2.5.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -O3 -Wno-error=shorten-64-to-32  -pipe   conftest.c  -L. -L~/.rubies/ruby-2.5.1/lib -L/usr/local/opt/libxml2/lib -L. -L~/.rubies/ruby-2.5.1/lib  -fstack-protector -L/usr/local/lib      -lxml2 -lruby.2.5.1-static -framework Foundation -lexslt -lxslt -lxml2 -lz -lpthread -licucore -lm -lxml2 -lpthread -lgmp -ldl -lobjc  "
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2:
    3: int main(int argc, char **argv)
    4: {
    5:   return 0;
    6: }
    /* end */
    
    | pkg-config --cflags-only-I libexslt
    => "-I/usr/include/libxml2\n"
    | pkg-config --cflags-only-other libexslt
    => "\n"
    | pkg-config --libs-only-l libexslt
    => "-lexslt -lxslt -lxml2 -lz -lpthread -licucore -lm -lxml2\n"
    package configuration for libexslt
    cflags:
    ldflags:
    libs: -lexslt -lxslt -lxml2 -lz -lpthread -licucore -lm -lxml2
    
    "clang -E -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-darwin18 -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/backward -I~/.rubies/ruby-2.5.1/include/ruby-2.5.0 -I. -I/usr/include/libxml2 -I/usr/include/libxml2 -I/usr/local/opt/libxml2/include -I~/.rubies/ruby-2.5.1/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -O3 -Wno-error=shorten-64-to-32  -pipe     conftest.c -o conftest.i"
    conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
    #include <libxml/xmlversion.h>
             ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2:
    3: #include <libxml/xmlversion.h>
    /* end */
    

    What operating system are you using?

    macOS 10.14 Mojave

    I've tried to reinstall everything what I could but without any success. I used pkg-config, libxml2 and libxslt from Homebrew...

    platform/osx 
    opened by deepj 41
  • Don't modify namespace prefixes for new fragments added into the document

    Don't modify namespace prefixes for new fragments added into the document

    Recently a commit fixed a bug when inserting a fragment with namespace prefixes into a node:

    http://github.com/tenderlove/nokogiri/commit/597195ff8fe471e5350581c2d5cce704fcf87439

    However it's coded under wrong assumptions (IMHO). Imagine this case:

    <?xml version='1.0' encoding='UTF-8'?>
    <cp:ruleset xmlns="default.ns" xmlns:cp="urn:common-policy">
      <cp:rule id="empty">
      </cp:rule>
    <cp:ruleset
    

    I want to insert a node: into <cp:rule id="empty"> node.

    Note that the new node has no NS prefix but it's not required at all since the XML document has a default namespace (xmlns="default.ns").

    However when inserting this new node Nokogiri converts it to: <cp:many id="all"/>. This is obviously wrong for sure. I want that the new node belongs to the NS "default.ns" so I have to avoid using NS prefix.

    Note that this has nothing to do with Xpath. This is, to get the new inserted node (if Nokogiri would insert it without adding a wrong "cp" prefix) I must use namespaces into the Xpath query:

    new_node = doc.xpath("ccpp:ruleset/ccpp:rule/yuhu:many", {"ccpp"=> "urn:common-policy", "yuhu"=>"default.ns"}
    

    So the namespaces used in the Xpath string are just useful for Nokogiri/libxml2 to search into the XML document, just it. But when insert a new node, its namespace prefixes don't require to match those used in the Xpath.

    In the thread about the above commit, Mike Dalessio said 3 assumptions: http://groups.google.com/group/nokogiri-talk/browse_thread/thread/f7f6509ad14ce340

    I would like to fix them:

    1. "document fragments should not have a namespace, by default"

    This is wrong. They could have or not, and that just depends on the existing XML document and the NS it uses. In case the document has a default namespace for the new node then this node must contain no NS prefix (as shown above in the example).

    1. "if a namespace is specified in the node fragment (like your cp:one fragment above), Nokogiri should check if the prefix matches any of the namespace definitions on the document root node. If it finds a match, the node should have that namespace. So in your above example, the node name would be "one" under the namespace with the prefix "cp"."

    This assumption fails. Namespace definitions on the document root node don't matter. Instead the namespace definitions on the parent node are the only important ones. Imagine this XML:

    <?xml version="1.0"?>
    <foo xmlns="urn:test:default-namespace">
      <ns1:bar xmlns:ns1="urn:test:namespace1-uri" xmlns="urn:test:namespace1-uri">
        <baz/>
        <ns2:baz xmlns:ns2="urn:test:namespace2-uri"/>
      </ns1:bar>
      <ns3:hi xmlns:ns3="urn:test:namespace3-uri">
        <there/>
      </ns3:hi>
    </foo>
    

    NS definitions on root node is just xmlns="urn:test:default-namespace". However, NS definitions on node are the following: "xmlns"=>"urn:test:namespace1-uri", "xmlns:ns1"=>"urn:test:namespace1-uri"

    This already works with Nokogiri when using the following Xpath query:

    doc.xpath("df:foo/df2:bar/df2:baz/namespace::*',
      {"df"=>"urn:ietf:params:xml:ns:common-policy", "df2"=>"urn:test:namespace1-uri"})
    
    1. "if a namespace is specified in the node fragment but does NOT match any of the namespace definitions on the document root, then the prefix will be silently ignored (which is libxml2's default behavior when parsing documents)."

    If this occurs it means that the insert operation is wrong and the only way to know it is by validating the XML against its schema. Leaving it with no NS prefix doesn't mean that the resulting XML is correct.

    So IMHO what Nokogiri should do is very easy: just nothing. When inserting a node Nokogiri shouldn't check the node namespace prefix, neither try to guess the appropriate one, neither replace it. It's the client responsability to use the appropriate namespaces prefixes. For this, the client can get the parent node namespaces definitions used in the XML document by using Xpath with "namespace::*" (as explained above).

    Finally, I tell that this wrong behavior of Nokogiri is breaking my application since I need to insert a node with no NS prefix into a parent node which has NS prefix (as in my first example), but Nokogiri corrupts the resulting XML by adding the parent NS prefixes to the new node.

    opened by ibc 40
  • build(deps-dev): update rubocop requirement from 1.41.1 to 1.42.0

    build(deps-dev): update rubocop requirement from 1.41.1 to 1.42.0

    Updates the requirements on rubocop to permit the latest version.

    Release notes

    Sourced from rubocop's releases.

    RuboCop 1.42

    New features

    Bug fixes

    • #11204: Fix a false negative for Lint/RedundantCopDisableDirective when using --except command line option. (@​koic)
    • #11369: Fix an error for Lint/UselessRuby2Keywords when using Proc#ruby2_keywords. (@​koic)
    • #11351: Fix an incorrect autocorrect for Lint/RegexpAsCondition when using regexp literal with bang. (@​koic)
    • #11329: Accept simple freezed constants in Layout/ClassStructure and correctly handle class methods. (@​fatkodima)
    • #11344: Fix an error for Style/GuardClause when using heredoc as an argument of raise in then branch and it does not have else branch. (@​koic)
    • #11335: Fix an error for Style/RequireOrder when only one reuqire. (@​koic)
    • #11348: Fix an error for Style/SelectByRegexp when block body is empty. (@​koic)
    • #11320: Fix a false positive for Lint/RequireParentheses when assigning ternary operator. (@​koic)
    • #11361: Make Style/MethodDefParentheses aware of Ruby 3.2's anonymous rest and keyword rest arguments. (@​koic)
    • #11346: Fix a false positive for Style/RedundantStringEscape when using escaped space in heredoc. (@​koic)
    • #10858: Fix Style/IdenticalConditionalBranches to ignore identical leading lines when branch has single child and is used in return context. (@​fatkodima)
    • #11237: Fix Layout/CommentIndentation comment aligned with access modifier indentation when EnforcedStyle is outdent. (@​soroktree)
    • #11330: Fix an error for Style/RequireOrder when using require inside rescue body. (@​fatkodima)
    • #8751: Accept super within ranges for Layout/SpaceAroundKeyword cop. (@​fatkodima)
    • #10194: Accept bracketed arrays within 2d arrays containing subarrays with complex content for Style/WordArray cop. (@​fatkodima)

    Changes

    Changelog

    Sourced from rubocop's changelog.

    1.42.0 (2023-01-01)

    New features

    Bug fixes

    • #11204: Fix a false negative for Lint/RedundantCopDisableDirective when using --except command line option. ([@​koic][])
    • #11369: Fix an error for Lint/UselessRuby2Keywords when using Proc#ruby2_keywords. ([@​koic][])
    • #11351: Fix an incorrect autocorrect for Lint/RegexpAsCondition when using regexp literal with bang. ([@​koic][])
    • #11329: Accept simple freezed constants in Layout/ClassStructure and correctly handle class methods. ([@​fatkodima][])
    • #11344: Fix an error for Style/GuardClause when using heredoc as an argument of raise in then branch and it does not have else branch. ([@​koic][])
    • #11335: Fix an error for Style/RequireOrder when only one reuqire. ([@​koic][])
    • #11348: Fix an error for Style/SelectByRegexp when block body is empty. ([@​koic][])
    • #11320: Fix a false positive for Lint/RequireParentheses when assigning ternary operator. ([@​koic][])
    • #11361: Make Style/MethodDefParentheses aware of Ruby 3.2's anonymous rest and keyword rest arguments. ([@​koic][])
    • #11346: Fix a false positive for Style/RedundantStringEscape when using escaped space in heredoc. ([@​koic][])
    • #10858: Fix Style/IdenticalConditionalBranches to ignore identical leading lines when branch has single child and is used in return context. ([@​fatkodima][])
    • #11237: Fix Layout/CommentIndentation comment aligned with access modifier indentation when EnforcedStyle is outdent. ([@​soroktree][])
    • #11330: Fix an error for Style/RequireOrder when using require inside rescue body. ([@​fatkodima][])
    • #8751: Accept super within ranges for Layout/SpaceAroundKeyword cop. ([@​fatkodima][])
    • #10194: Accept bracketed arrays within 2d arrays containing subarrays with complex content for Style/WordArray cop. ([@​fatkodima][])

    Changes

    • #8366: Ignore private constants in Layout/ClassStructure cop. ([@​fatkodima][])
    • #11325: Support autocorrection for percent literals in Style/ConcatArrayLiterals. ([@​fatkodima][])
    • #11327: Make Style/ZeroLengthPredicate aware of array.length.zero?. ([@​koic][])
    • #10976: Support pattern matching for Lint/OutOfRangeRegexpRef cop. ([@​fatkodima][])

    1.41.1 (2022-12-22)

    Bug fixes

    • #11293: Fix a false negative for Style/Documentation when using macro. ([@​koic][])
    • #11313: Fix a false positive for Naming/BlockForwarding when the block argument is reassigned. ([@​fatkodima][])
    • #11014: Fix a false positive for Style/Aliascop when alias in a method def. ([@​ydah][])
    • #11309: Fix a false positive for Style/RedundantStringEscape when using a redundant escaped string interpolation \#\{foo}. ([@​koic][])
    • #11307: Fix an error for Style/GuardClause when using lvar as an argument of raise in else branch. ([@​ydah][])
    • #11308: Fix disabling departments via comment. ([@​fatkodima][])

    Changes

    1.41.0 (2022-12-20)

    ... (truncated)

    Commits
    • 0f7416a Cut 1.42
    • b58c2cd Update Changelog
    • d8e5332 Merge pull request #11372 from koic/ci_against_ruby_3_2_on_windows
    • ac9e723 CI against Ruby 3.2 on Windows
    • 33bf9a0 Fix an error for Lint/UselessRuby2Keywords
    • 3cce8c8 Fix Style/WordArray for subarrays
    • d5c303a Bump license years to 2023
    • 32e13c5 Improve offense message for Style/YodaExpression cop
    • d4aeaf1 [Doc] Update the doc for Style/MinMaxComparison
    • 7b4adef Add examples for 2d arrays to Style/WordArray cop
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • build(deps-dev): update rubocop-shopify requirement from = 2.9.0 to 2.10.1

    build(deps-dev): update rubocop-shopify requirement from = 2.9.0 to 2.10.1

    Updates the requirements on rubocop-shopify to permit the latest version.

    Commits
    • 7d1034e Prepare for 2.10.1
    • 56392c4 Merge pull request #444 from Shopify/rm-comma
    • 3253231 Set Style/TrailingCommaInArguments's EnforcedStyleForMultiline to comma
    • 71f6759 Prepare for 2.10.0
    • a395fe6 Merge pull request #443 from Shopify/remove-probot
    • bfd194b Remove Probot
    • 81a80b3 Merge pull request #441 from Shopify/dependabot/bundler/rubocop-1.36.0
    • 9ea7d8f Enable Style/CaseEquality AllowOnSelfClass option
    • 6c8269a Dump updated config
    • ae342e0 Bump rubocop from 1.35.1 to 1.36.0
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • perf: use default memory management within libxml2

    perf: use default memory management within libxml2

    What problem is this PR intended to solve?

    Related to #2722, performance.

    use default memory management within libxml2 instead of ruby's memory management functions (which has been used since 2009).

    HTML4 parsing is 14-19% faster:

    alloc html4 parse 656:    22371.3 i/s
    BASE_ html4 parse 656:    19589.4 i/s - 1.14x  (± 0.03) slower
    
    alloc html4 parse 70095:      461.4 i/s
    BASE_ html4 parse 70095:      385.5 i/s - 1.19x  (± 0.11) slower
    
    alloc html4 parse 1929522:       43.7 i/s
    BASE_ html4 parse 1929522:       37.2 i/s - 1.18x  (± 0.05) slower
    

    HTML5 parsing is 5-8% faster:

    alloc html5 parse 656:    17909.1 i/s
    BASE_ html5 parse 656:    16597.7 i/s - 1.08x  (± 0.04) slower
    
    alloc html5 parse 70095:      277.3 i/s
    BASE_ html5 parse 70095:      263.4 i/s - same-ish: difference falls within error
    
    alloc html5 parse 1929522:       16.6 i/s
    BASE_ html5 parse 1929522:       15.8 i/s - 1.05x  (± 0.03) slower
    

    HTML4 serialization is 10-14% faster:

    alloc html4 srlze 656:    69707.3 i/s
    BASE_ html4 srlze 656:    63537.4 i/s - 1.10x  (± 0.02) slower
    
    alloc html4 srlze 70095:     1504.5 i/s
    BASE_ html4 srlze 70095:     1331.9 i/s - 1.13x  (± 0.02) slower
    
    alloc html4 srlze 1929522:      145.5 i/s
    BASE_ html4 srlze 1929522:      128.0 i/s - 1.14x  (± 0.02) slower
    

    HTML5 serialization is not very impacted, as expected.

    alloc html5 srlze 656:    42255.7 i/s
    BASE_ html5 srlze 656:    41118.8 i/s - 1.03x  (± 0.02) slower
    
    alloc html5 srlze 70095:     1050.6 i/s
    BASE_ html5 srlze 70095:     1033.8 i/s - same-ish: difference falls within error
    
    alloc html5 srlze 1929522:      121.5 i/s
    BASE_ html5 srlze 1929522:      118.3 i/s - 1.03x  (± 0.02) slower
    

    Have you included adequate test coverage?

    N/A

    Does this change affect the behavior of either the C or the Java implementations?

    N/A

    topic/performance 
    opened by flavorjones 6
  • explore further optimizing the HTML5 parser and serializer

    explore further optimizing the HTML5 parser and serializer

    Ideally we want HTML5 to be the default HTML parser in Nokogiri (see #2331). Some necessary work before we do that is to make sure it's as performant as we can make it.

    This issue is open-ended and meant to collect the conversations and optimizations attempts we've made.

    Work summary (kept up to date):

    • https://github.com/sparklemotion/nokogiri/pull/2403 (previous work)
    • https://github.com/sparklemotion/nokogiri/issues/2569 (previous work)
    • https://github.com/sparklemotion/nokogiri/pull/2596 (previous work)
    • https://github.com/sparklemotion/nokogiri/pull/2639 (previous work)
    • https://github.com/sparklemotion/nokogiri/pull/2723
    • https://github.com/sparklemotion/nokogiri/pull/2734
    • https://github.com/sparklemotion/nokogiri/pull/2735
    topic/HTML5 topic/performance topic/gumbo 
    opened by flavorjones 9
  • [build bug] Modifying gumbo source doesn't cause rebuilds

    [build bug] Modifying gumbo source doesn't cause rebuilds

    Please describe the bug

    Modifying the gumbo source files doesn't cause rake compile:nokogiri to rebuild the extension.

    Help us reproduce what you're seeing

    1. Compile the extension with rake compile:nokogiri
    2. Touch a gumbo source file: touch gumbo-parser/src/util.h
    3. Recompile the extension with rake compile:nokogiri
    $ bundle exec rake compile:nokogiri
    /usr/bin/make install target_prefix=
    install -c -p -m 755 nokogiri.bundle /Users/steve/programming/nokogiri/lib/nokogiri
    cp tmp/arm64-darwin21/nokogiri/3.1.2/nokogiri.bundle tmp/arm64-darwin21/stage/lib/nokogiri/nokogiri.bundle
    $ touch gumbo-parser/src/util.h
    $ bundle exec rake compile:nokogiri
    cp gumbo-parser/src/util.h tmp/arm64-darwin21/stage/gumbo-parser/src/util.h
    /usr/bin/make install target_prefix=
    install -c -p -m 755 nokogiri.bundle /Users/steve/programming/nokogiri/lib/nokogiri
    cp tmp/arm64-darwin21/nokogiri/3.1.2/nokogiri.bundle tmp/arm64-darwin21/stage/lib/nokogiri/nokogiri.bundle
    

    Note that the extension was already compiled for the first invocation so nothing needed to be done. In the second compilation, it also thinks there's nothing to do. (The same holds true if you actually modify the file, not merely touch it, but touching is traditionally sufficient for build systems.)

    Expected behavior

    I expect the gumbo library to be recompiled (or at least the parts of it that were changed) and the nokogiri.bundle to be rebuilt.

    Environment

    • I'm building the main branch.
    • ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
    • macOS 13.0.1
    state/needs-triage 
    opened by stevecheckoway 2
  • [draft] (jruby) namespaced attributes

    [draft] (jruby) namespaced attributes

    What problem is this PR intended to solve?

    #2677 pointed out inconsistent behavior in the JRuby implementation with respect to namespaced attributes.

    This PR is a work-in-progress, because although I can fix the immediate problem reported in #2677, that fix surfaced other bugs in the JRuby implementation. See the test added in the most recent commit, as well as one other related failing test, to see the problem.

    Have you included adequate test coverage?

    Yes

    Does this change affect the behavior of either the C or the Java implementations?

    This PR fixes the JRuby behavior to match the CRuby behavior.

    platform/jruby 
    opened by flavorjones 0
Releases(v1.14.0.rc1)
  • v1.14.0.rc1(Dec 29, 2022)

    1.14.0.rc1 / 2022-12-29

    This is a prerelease.

    • Please provide feedback on it at https://github.com/sparklemotion/nokogiri/discussions/2747
    • Full details on this release are at https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md

    Notable changes:

    • Introduces native gem support for Ruby 3.2.
    • Ends support for Ruby 2.6 and JRuby 9.3
    • Official native gem support for aarch64-linux
    • Experimental native gem support for arm-linux
    • Pattern matching API

    Please note that Ruby 3.2 changes how symbols are resolved on MacOS, so we're particularly interested in hearing feedback from MacOS users about the native (precompiled) gem packages for Ruby 3.2.

    We're waiting for the following to do a final release:

    • a final release of rake-compiler-dock that supports Ruby 3.2
    • Windows CI environment that runs Ruby 3.2.0, and green tests
    • feedback to build confidence that our approach to Darwin symbol resolution in the precompiled extension works for everyone

    sha256 checksums:

    9cb5140f400c3599ba9da92a338d2384976179a05e15267d5bda27ce5ab5294a  nokogiri-1.14.0.rc1-aarch64-linux.gem
    70946d652626925f0e7d8cb0f03e45b81423496e8f0db30dce7aecccc33336c6  nokogiri-1.14.0.rc1-arm-linux.gem
    8562ed2a3765f2020e340d4cbde72c582843191b20114eb24bcc313307483873  nokogiri-1.14.0.rc1-arm64-darwin.gem
    6359f13cccc526936913bac3515a3d3d7d1ffde5dffff4eadaaf3cad126fc753  nokogiri-1.14.0.rc1-java.gem
    c83050f34b78690bd13398ad91cace3c32957614fd7b6e5ce7098386340cd23d  nokogiri-1.14.0.rc1-x64-mingw-ucrt.gem
    4d2edec4b79735b648eca12c5d52b52d03f4ffd300ccacf8fda9169227eb6a4d  nokogiri-1.14.0.rc1-x64-mingw32.gem
    55d334f128d86a20497a3fa4e24c67098199dc9428a44b77284cff6c95104c35  nokogiri-1.14.0.rc1-x86-linux.gem
    79e1b2f25a26a9a4a87d3af64a47be27ee3cc4ec0d02eef681b64cd8b610e2a6  nokogiri-1.14.0.rc1-x86-mingw32.gem
    c359c27e275da0f82d09c25f6efafd116546d2c7c43c91e9393567f00aa3064a  nokogiri-1.14.0.rc1-x86_64-darwin.gem
    e15e2c0f844bd113e1b409dfb534b7e2c727b10812734064c05a732b6342f28c  nokogiri-1.14.0.rc1-x86_64-linux.gem
    9d527b0b6eeb88f48bc90648df11824f247019e08b95f5a75b6ea02cefcf499a  nokogiri-1.14.0.rc1.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.10(Dec 8, 2022)

    1.13.10 / 2022-12-07

    Security

    • [CRuby] Address CVE-2022-23476, unchecked return value from xmlTextReaderExpand. See GHSA-qv4q-mr5r-qprj for more information.

    Improvements

    • [CRuby] XML::Reader#attribute_hash now returns nil on parse errors. This restores the behavior of #attributes from v1.13.7 and earlier. [#2715]

    sha256 checksums:

    777ce2e80f64772e91459b943e531dfef387e768f2255f9bc7a1655f254bbaa1  nokogiri-1.13.10-aarch64-linux.gem
    b432ff47c51386e07f7e275374fe031c1349e37eaef2216759063bc5fa5624aa  nokogiri-1.13.10-arm64-darwin.gem
    73ac581ddcb680a912e92da928ffdbac7b36afd3368418f2cee861b96e8c830b  nokogiri-1.13.10-java.gem
    916aa17e624611dddbf2976ecce1b4a80633c6378f8465cff0efab022ebc2900  nokogiri-1.13.10-x64-mingw-ucrt.gem
    0f85a1ad8c2b02c166a6637237133505b71a05f1bb41b91447005449769bced0  nokogiri-1.13.10-x64-mingw32.gem
    91fa3a8724a1ce20fccbd718dafd9acbde099258183ac486992a61b00bb17020  nokogiri-1.13.10-x86-linux.gem
    d6663f5900ccd8f72d43660d7f082565b7ffcaade0b9a59a74b3ef8791034168  nokogiri-1.13.10-x86-mingw32.gem
    81755fc4b8130ef9678c76a2e5af3db7a0a6664b3cba7d9fe8ef75e7d979e91b  nokogiri-1.13.10-x86_64-darwin.gem
    51d5246705dedad0a09b374d09cc193e7383a5dd32136a690a3cd56e95adf0a3  nokogiri-1.13.10-x86_64-linux.gem
    d3ee00f26c151763da1691c7fc6871ddd03e532f74f85101f5acedc2d099e958  nokogiri-1.13.10.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.9(Oct 18, 2022)

    1.13.9 / 2022-10-18

    Security

    Dependencies

    • [CRuby] Vendored libxml2 is updated to v2.10.3 from v2.9.14.
    • [CRuby] Vendored libxslt is updated to v1.1.37 from v1.1.35.
    • [CRuby] Vendored zlib is updated from 1.2.12 to 1.2.13. (See LICENSE-DEPENDENCIES.md for details on which packages redistribute this library.)

    Fixed

    • [CRuby] Nokogiri::XML::Namespace objects, when compacted, update their internal struct's reference to the Ruby object wrapper. Previously, with GC compaction enabled, a segmentation fault was possible after compaction was triggered. [#2658] (Thanks, @eightbitraptor and @peterzhu2118!)
    • [CRuby] Document#remove_namespaces! now defers freeing the underlying xmlNs struct until the Document is GCed. Previously, maintaining a reference to a Namespace object that was removed in this way could lead to a segfault. [#2658]

    sha256 checksums:

    9b69829561d30c4461ea803baeaf3460e8b145cff7a26ce397119577a4083a02  nokogiri-1.13.9-aarch64-linux.gem
    e76ebb4b7b2e02c72b2d1541289f8b0679fb5984867cf199d89b8ef485764956  nokogiri-1.13.9-arm64-darwin.gem
    15bae7d08bddeaa898d8e3f558723300137c26a2dc2632a1f89c8574c4467165  nokogiri-1.13.9-java.gem
    f6a1dbc7229184357f3129503530af73cc59ceba4932c700a458a561edbe04b9  nokogiri-1.13.9-x64-mingw-ucrt.gem
    36d935d799baa4dc488024f71881ff0bc8b172cecdfc54781169c40ec02cbdb3  nokogiri-1.13.9-x64-mingw32.gem
    ebaf82aa9a11b8fafb67873d19ee48efb565040f04c898cdce8ca0cd53ff1a12  nokogiri-1.13.9-x86-linux.gem
    11789a2a11b28bc028ee111f23311461104d8c4468d5b901ab7536b282504154  nokogiri-1.13.9-x86-mingw32.gem
    01830e1646803ff91c0fe94bc768ff40082c6de8cfa563dafd01b3f7d5f9d795  nokogiri-1.13.9-x86_64-darwin.gem
    8e93b8adec22958013799c8690d81c2cdf8a90b6f6e8150ab22e11895844d781  nokogiri-1.13.9-x86_64-linux.gem
    96f37c1baf0234d3ae54c2c89aef7220d4a8a1b03d2675ff7723565b0a095531  nokogiri-1.13.9.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.8(Jul 23, 2022)

    1.13.8 / 2022-07-23

    Deprecated

    • XML::Reader#attribute_nodes is deprecated due to incompatibility between libxml2's xmlReader memory semantics and Ruby's garbage collector. Although this method continues to exist for backwards compatibility, it is unsafe to call and may segfault. This method will be removed in a future version of Nokogiri, and callers should use #attribute_hash instead. [#2598]

    Improvements

    • XML::Reader#attribute_hash is a new method to safely retrieve the attributes of a node from XML::Reader. [#2598, #2599]

    Fixed

    • [CRuby] Calling XML::Reader#attributes is now safe to call. In Nokogiri <= 1.13.7 this method may segfault. [#2598, #2599]

    sha256 checksums:

    d6b2c45a57738f12fe27783939fe1394e7049246288c7770d3b1fee7f49432a6  nokogiri-1.13.8-aarch64-linux.gem
    00217e48a6995e81dd83014325c0ea0b015023a8922c7bdb2ef1416aa87c1f43  nokogiri-1.13.8-arm64-darwin.gem
    9d04c616900e2b5118e501436ebb9bc48520d08f3695d012a314006e28082f72  nokogiri-1.13.8-java.gem
    98f7dac7583f07a84ec3fcc01dc03a66fce10f412cd363fce7de749acdb2a42d  nokogiri-1.13.8-x64-mingw-ucrt.gem
    117a71b37f2e1d774a9f031d393e72d5d04b92af8036e0c1a8dd509c247b2013  nokogiri-1.13.8-x64-mingw32.gem
    6d04342456edfb8fbc041d0c2cf5a59baaa7aacdda414b2333100b02f85d441d  nokogiri-1.13.8-x86-linux.gem
    0529d558b4280a55bc7af500d3d4d590b7c059c814a0cea52e4e18cb30c25d15  nokogiri-1.13.8-x86-mingw32.gem
    8966d79e687b271df87a4b240456597c43cd98584e3f783fc35de4f066486421  nokogiri-1.13.8-x86_64-darwin.gem
    344f1bc66feac787e5b2053c6e9095d1f33605083e58ddf2b8d4eef257bccc5f  nokogiri-1.13.8-x86_64-linux.gem
    79c279298b2f22fd4e760f49990c7930436bac1b1cfeff7bacff192f30edea3c  nokogiri-1.13.8.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.7(Jul 12, 2022)

    1.13.7 / 2022-07-12

    Fixed

    XML::Node objects, when compacted, update their internal struct's reference to the Ruby object wrapper. Previously, with GC compaction enabled, a segmentation fault was possible after compaction was triggered. [#2578] (Thanks, @eightbitraptor!)


    sha256 checksums:

    16facd06367325b75bba1575ee87ee4c695e017ab7d447106ed2c00d6211db43  nokogiri-1.13.7-aarch64-linux.gem
    69a1705a1f2be838bd0a778c1ff04ea58f847a41c3b5159de012617abba53f86  nokogiri-1.13.7-arm64-darwin.gem
    6f26c7ed388406541ddc10cf7ea670cebe8f08a37e69be60503687374f835e1a  nokogiri-1.13.7-java.gem
    3952cb78db8d107942ec7f3096d417f4d5d77bf44ae812c488bc49269d1dde6a  nokogiri-1.13.7-x64-mingw-ucrt.gem
    e836c387eae9c6c93d4870db0d50e4d9505edd28100eef80c38a70d4481c09ed  nokogiri-1.13.7-x64-mingw32.gem
    194484866cd0d100ee6e207a69611a63ece9e0cf305e42d449f244526e102f63  nokogiri-1.13.7-x86-linux.gem
    f75903e7a1fbb896b8bd6e4ed895a0fc1760e7334b9c7faf2593f491907a9e26  nokogiri-1.13.7-x86-mingw32.gem
    d41b8c9f609b3eecb129da52b9605bc833e464b9b9132c29a0c2115e5ea0ab57  nokogiri-1.13.7-x86_64-darwin.gem
    dcb36fd4e75782e7b1b3315f464a0942b230497cd21d296a24d90b0d3620a9d0  nokogiri-1.13.7-x86_64-linux.gem
    6ca1d753334418e749beb9bb69515a906451c9abfb9a5b060a36650419b61052  nokogiri-1.13.7.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.6(May 8, 2022)

    1.13.6 / 2022-05-08

    Security

    • [CRuby] Address CVE-2022-29181, improper handling of unexpected data types, related to untrusted inputs to the SAX parsers. See GHSA-xh29-r2w5-wx8m for more information.

    Improvements

    • {HTML4,XML}::SAX::{Parser,ParserContext} constructor methods now raise TypeError instead of segfaulting when an incorrect type is passed.

    sha256:

    58417c7c10f78cd1c0e1984f81538300d4ea98962cfd3f46f725efee48f9757a  nokogiri-1.13.6-aarch64-linux.gem
    a2b04ec3b1b73ecc6fac619b41e9fdc70808b7a653b96ec97d04b7a23f158dbc  nokogiri-1.13.6-arm64-darwin.gem
    4437f2d03bc7da8854f4aaae89e24a98cf5c8b0212ae2bc003af7e65c7ee8e27  nokogiri-1.13.6-java.gem
    99d3e212bbd5e80aa602a1f52d583e4f6e917ec594e6aa580f6aacc253eff984  nokogiri-1.13.6-x64-mingw-ucrt.gem
    a04f6154a75b6ed4fe2d0d0ff3ac02f094b54e150b50330448f834fa5726fbba  nokogiri-1.13.6-x64-mingw32.gem
    a13f30c2863ef9e5e11240dd6d69ef114229d471018b44f2ff60bab28327de4d  nokogiri-1.13.6-x86-linux.gem
    63a2ca2f7a4f6bd9126e1695037f66c8eb72ed1e1740ef162b4480c57cc17dc6  nokogiri-1.13.6-x86-mingw32.gem
    2b266e0eb18030763277b30dc3d64337f440191e2bd157027441ac56a59d9dfe  nokogiri-1.13.6-x86_64-darwin.gem
    3fa37b0c3b5744af45f9da3e4ae9cbd89480b35e12ae36b5e87a0452e0b38335  nokogiri-1.13.6-x86_64-linux.gem
    b1512fdc0aba446e1ee30de3e0671518eb363e75fab53486e99e8891d44b8587  nokogiri-1.13.6.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.5(May 4, 2022)

    1.13.5 / 2022-05-04

    Security

    Dependencies

    • [CRuby] Vendored libxml2 is updated from v2.9.13 to v2.9.14.

    Improvements

    • [CRuby] The libxml2 HTML4 parser no longer exhibits quadratic behavior when recovering some broken markup related to start-of-tag and bare < characters.

    Changed

    • [CRuby] The libxml2 HTML4 parser in v2.9.14 recovers from some broken markup differently. Notably, the XML CDATA escape sequence <![CDATA[ and incorrectly-opened comments will result in HTML text nodes starting with &lt;! instead of skipping the invalid tag. This behavior is a direct result of the quadratic-behavior fix noted above. The behavior of downstream sanitizers relying on this behavior will also change. Some tests describing the changed behavior are in test/html4/test_comments.rb.

    sha256sum:

    aa1bfd0fd0b33110729d4a063b7b02de9419c559eb48a1f8940b74fc638d60ea  nokogiri-1.13.5-aarch64-linux.gem
    d0b872786d6c2b44c10a389e585a77c07274a2b5e7211a470f76909c0711f218  nokogiri-1.13.5-arm64-darwin.gem
    3f1434c198f0daf46d24c4696a53504beb69b8c15efe0548a7aa17a8378be21d  nokogiri-1.13.5-java.gem
    0e60dc107c7e289dd3817acff14a12c9f4447a994a2411f772d6dd1220a35ae6  nokogiri-1.13.5-x64-mingw-ucrt.gem
    c9897dd7236738d260b66ac99ea93950fd3a6375f11a9927bf345eec4ec1fde6  nokogiri-1.13.5-x64-mingw32.gem
    a81586845f99a16a85586717b0051ce1508a68722a56486582ab09b3255d3b17  nokogiri-1.13.5-x86-linux.gem
    e2abaef3af396adee3b0995693d5e690eb826782f7ecddf8b1b6a5a706075cff  nokogiri-1.13.5-x86-mingw32.gem
    19360ba28f31562691926d1c542c783fc0ed5f2a145f1329206f8c09e46a85ea  nokogiri-1.13.5-x86_64-darwin.gem
    a598598163233ee907472808c0bc7ae4354999e77409e1711b61406066a7afb4  nokogiri-1.13.5-x86_64-linux.gem
    e15570ec6d46921a3de5f5b057b027cc0c4f32775353c00e8c8dfbe443741e78  nokogiri-1.13.5.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.4(Apr 11, 2022)

    1.13.4 / 2022-04-11

    Security

    Dependencies

    • [CRuby] Vendored zlib is updated from 1.2.11 to 1.2.12. (See LICENSE-DEPENDENCIES.md for details on which packages redistribute this library.)
    • [JRuby] Vendored Xerces-J (xerces:xercesImpl) is updated from 2.12.0 to 2.12.2.
    • [JRuby] Vendored nekohtml (org.cyberneko.html) is updated from a fork of 1.9.21 to 1.9.22.noko2. This fork is now publicly developed at https://github.com/sparklemotion/nekohtml

    sha256sum:

    095ff1995ed3dda3ea98a5f08bdc54bef02be1ce4e7c81034c4812e5e7c6e7e3  nokogiri-1.13.4-aarch64-linux.gem
    7ebfc7415c819bcd4e849627e879cef2fb328bec90e802e50d74ccd13a60ec75  nokogiri-1.13.4-arm64-darwin.gem
    41efd87c121991de26ef0393ac713d687e539813c3b79e454a2e3ffeecd107ea  nokogiri-1.13.4-java.gem
    ab547504692ada0cec9d2e4e15afab659677c3f4c1ac3ea639bf5212b65246a1  nokogiri-1.13.4-x64-mingw-ucrt.gem
    fa5c64cfdb71642ed647428e4d0d75ee0f4d189cfb63560c66fd8bdf99eb146b  nokogiri-1.13.4-x64-mingw32.gem
    d6f07cbcbc28b75e8ac5d6e729ffba3602dffa0ad16ffac2322c9b4eb9b971fc  nokogiri-1.13.4-x86-linux.gem
    0f7a4fd13e25abe3f98663fef0d115d58fdeff62cf23fef12d368e42adad2ce6  nokogiri-1.13.4-x86-mingw32.gem
    3eef282f00ad360304fbcd5d72eb1710ff41138efda9513bb49eec832db5fa3e  nokogiri-1.13.4-x86_64-darwin.gem
    3978610354ec67b59c128d23259c87b18374ee1f61cb9ed99de7143a88e70204  nokogiri-1.13.4-x86_64-linux.gem
    0d46044eb39271e3360dae95ed6061ce17bc0028d475651dc48db393488c83bc  nokogiri-1.13.4.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.3(Feb 22, 2022)

    1.13.3 / 2022-02-21

    Fixed

    • [CRuby] Revert a HTML4 parser bug in libxml 2.9.13 (introduced in Nokogiri v1.13.2). The bug causes libxml2's HTML4 parser to fail to recover when encountering a bare < character in some contexts. This version of Nokogiri restores the earlier behavior, which is to recover from the parse error and treat the < as normal character data (which will be serialized as &lt; in a text node). The bug (and the fix) is only relevant when the RECOVER parse option is set, as it is by default. [#2461]

    SHA256 checksums:

    025a4e333f6f903072a919f5f75b03a8f70e4969dab4280375b73f9d8ff8d2c0  nokogiri-1.13.3-aarch64-linux.gem
    b9cb59c6a6da8cf4dbee5dbb569c7cc95a6741392e69053544e0f40b15ab9ad5  nokogiri-1.13.3-arm64-darwin.gem
    e55d18cee64c19d51d35ad80634e465dbcdd46ac4233cb42c1e410307244ebae  nokogiri-1.13.3-java.gem
    53e2d68116cd00a873406b8bdb90c78a6f10e00df7ddf917a639ac137719b67b  nokogiri-1.13.3-x64-mingw-ucrt.gem
    b5f39ebb662a1be7d1c61f8f0a2a683f1bb11690a6f00a99a1aa23a071f80145  nokogiri-1.13.3-x64-mingw32.gem
    7c0de5863aace4bbbc73c4766cf084d1f0b7a495591e46d1666200cede404432  nokogiri-1.13.3-x86-linux.gem
    675cc3e7d7cca0d6790047a062cd3aa3eab59e3cb9b19374c34f98bade588c66  nokogiri-1.13.3-x86-mingw32.gem
    f445596a5a76941a9d1980747535ab50d3399d1b46c32989bc26b7dd988ee498  nokogiri-1.13.3-x86_64-darwin.gem
    3f6340661c2a283b337d227ea224f859623775b2f5c09a6bf197b786563958df  nokogiri-1.13.3-x86_64-linux.gem
    bf1b1bceff910abb0b7ad825535951101a0361b859c2ad1be155c010081ecbdc  nokogiri-1.13.3.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.2(Feb 21, 2022)

    1.13.2 / 2022-02-21

    Security

    • [CRuby] Vendored libxml2 is updated from 2.9.12 to 2.9.13. This update addresses CVE-2022-23308.
    • [CRuby] Vendored libxslt is updated from 1.1.34 to 1.1.35. This update addresses CVE-2021-30560.

    Please see GHSA-fq42-c5rg-92c2 for more information about these CVEs.

    Dependencies

    • [CRuby] Vendored libxml2 is updated from 2.9.12 to 2.9.13. Full changelog is available at https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.news
    • [CRuby] Vendored libxslt is updated from 1.1.34 to 1.1.35. Full changelog is available at https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.35.news

    SHA256 checksums:

    63469a9bb56a21c62fbaea58d15f54f8f167ff6fde51c5c2262072f939926fdd  nokogiri-1.13.2-aarch64-linux.gem
    2986617f982f645c06f22515b721e6d2613dd69493e5c41ddd03c4830c3b3065  nokogiri-1.13.2-arm64-darwin.gem
    aca1d66206740b29d0d586b1d049116adcb31e6cdd7c4dd3a96eb77da215a0c4  nokogiri-1.13.2-java.gem
    b9e4eea1a200d9a927a5bc7d662c427e128779cba0098ea49ddbdb3ffc3ddaec  nokogiri-1.13.2-x64-mingw-ucrt.gem
    48d5493fec495867c5516a908a068c1387a1d17c5aeca6a1c98c089d9d9fdcf8  nokogiri-1.13.2-x64-mingw32.gem
    62034d7aaaa83fbfcb8876273cc5551489396841a66230d3200b67919ef76cf9  nokogiri-1.13.2-x86-linux.gem
    e07237b82394017c2bfec73c637317ee7dbfb56e92546151666abec551e46d1d  nokogiri-1.13.2-x86-mingw32.gem
    01937a6551d997aca32468da08ced0878ba4e1dfd0b51d953617185eefc57ffa  nokogiri-1.13.2-x86_64-darwin.gem
    70112ae29939d4b5e1c8ba13e1f0d82ff43cd5564ce138f622fe6ebddc503654  nokogiri-1.13.2-x86_64-linux.gem
    def6b330c53dcabe8b7d545cf9db4dfb45e9d39040b531eb81aee0c840fd66c2  nokogiri-1.13.2.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.1(Jan 13, 2022)

    1.13.1 / 2022-01-13

    Fixed

    • Fix Nokogiri::XSLT.quote_params regression in v1.13.0 that raised an exception when non-string stylesheet parameters were passed. Non-string parameters (e.g., integers and symbols) are now explicitly supported and both keys and values will be stringified with #to_s. [#2418]
    • Fix HTML5 CSS selector query regression in v1.13.0 that raised an Nokogiri::XML::XPath::SyntaxError when parsing XPath attributes mixed into the CSS query. Although this mash-up of XPath and CSS syntax previously worked unintentionally, it is now an officially supported feature and is documented as such. [#2419]

    SHA265 checksums

    9206569b36f0066f943f174a832b50e69551c2a81333b7a62d4073e97ea4c3c6  nokogiri-1.13.1-aarch64-linux.gem
    39d73197506acd3748c84600e000bb44ccd930695a9fc8b489b1b4df37dd14f0  nokogiri-1.13.1-arm64-darwin.gem
    1aaa315876e2049b4418c60794f1f55bdb04cc9583b9b664dbb3c52696695207  nokogiri-1.13.1-java.gem
    37d97e5fdaae4a14cc7122598616ac484d71c271004fb6cce6684c6734f41552  nokogiri-1.13.1-x64-mingw-ucrt.gem
    683b030957c747d35499f8d766cad51a31ae9456098225af62fab7b27fe20129  nokogiri-1.13.1-x64-mingw32.gem
    690958426e3151ba0c22e8d88637dba5e0c636107f3def2ffc10e334d451e61f  nokogiri-1.13.1-x86-linux.gem
    30f94872729a1bbd41d6e2080bb0d48f4137a1323530263fd88299b41666ca06  nokogiri-1.13.1-x86-mingw32.gem
    1fa3a5c9a460292ff03c7347185d2c394978c94fc96fd414bbfa8cef3eac7d72  nokogiri-1.13.1-x86_64-darwin.gem
    843a379997c88a1b3d7524cd27b3ee652444f5371ff449af09929602fa26dfb5  nokogiri-1.13.1-x86_64-linux.gem
    2138bb8e1bd5f11c2dc57a6a7ed93ddce35825dae7d25262658d89a222571fff  nokogiri-1.13.1.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.13.0(Jan 6, 2022)

    1.13.0 / 2022-01-06

    Notes

    Ruby

    This release introduces native gem support for Ruby 3.1. Please note that Windows users should use the x64-mingw-ucrt platform gem for Ruby 3.1, and x64-mingw32 for Ruby 2.6–3.0 (see RubyInstaller 3.1.0 release notes).

    This release ends support for:

    Faster, more reliable installation: Native Gem for ARM64 Linux

    This version of Nokogiri ships experimental native gem support for the aarch64-linux platform, which should support AWS Graviton and other ARM Linux platforms. We don't yet have CI running for this platform, and so we're interested in hearing back from y'all whether this is working, and what problems you're seeing. Please send us feedback here: Feedback: Have you used the aarch64-linux native gem?

    Publishing

    This version of Nokogiri opts-in to the "MFA required to publish" setting on Rubygems.org. This and all future Nokogiri gem files must be published to Rubygems by an account with multi-factor authentication enabled. This should provide some additional protection against supply-chain attacks.

    A related discussion about Trust exists at #2357 in which I invite you to participate if you have feelings or opinions on this topic.

    Dependencies

    • [CRuby] Vendored libiconv is updated from 1.15 to 1.16. (Note that libiconv is only redistributed in the native windows and native darwin gems, see LICENSE-DEPENDENCIES.md for more information.) [#2206]
    • [CRuby] Upgrade mini_portile2 dependency from ~> 2.6.1 to ~> 2.7.0. ("ruby" platform gem only.)

    Improved

    • {XML,HTML4}::DocumentFragment constructors all now take an optional parse options parameter or block (similar to Document constructors). [#1692] (Thanks, @JackMc!)
    • Nokogiri::CSS.xpath_for allows an XPathVisitor to be injected, for finer-grained control over how CSS queries are translated into XPath.
    • [CRuby] XML::Reader#encoding will return the encoding detected by the parser when it's not passed to the constructor. [#980]
    • [CRuby] Handle abruptly-closed HTML comments as recommended by WHATWG. (Thanks to tehryanx for reporting!)
    • [CRuby] Node#line is no longer capped at 65535. libxml v2.9.0 and later support a new parse option, exposed as Nokogiri::XML::ParseOptions::PARSE_BIG_LINES, which is turned on by default in ParseOptions::DEFAULT_{XML,XSLT,HTML,SCHEMA} (Note that JRuby already supported large line numbers.) [#1764, #1493, #1617, #1505, #1003, #533]
    • [CRuby] If a cycle is introduced when reparenting a node (i.e., the node becomes its own ancestor), a RuntimeError is raised. libxml2 does no checking for this, which means cycles would otherwise result in infinite loops on subsequent operations. (Note that JRuby already did this.) [#1912]
    • [CRuby] Source builds will download zlib and libiconv via HTTPS. ("ruby" platform gem only.) [#2391] (Thanks, @jmartin-r7!)
    • [JRuby] Node#line behavior has been modified to return the line number of the node in the final DOM structure. This behavior is different from CRuby, which returns the node's position in the input string. Ideally the two implementations would be the same, but at least is now officially documented and tested. The real-world impact of this change is that the value returned in JRuby is greater by 1 to account for the XML prolog in the output. [#2380] (Thanks, @dabdine!)

    Fixed

    • CSS queries on HTML5 documents now correctly match foreign elements (SVG, MathML) when namespaces are not specified in the query. [#2376]
    • XML::Builder blocks restore context properly when exceptions are raised. [#2372] (Thanks, @ric2b and @rinthedev!)
    • The Nokogiri::CSS::Parser cache now uses the XPathVisitor configuration as part of the cache key, preventing incorrect cache results from being returned when multiple XPathVisitor options are being used.
    • Error recovery from in-context parsing (e.g., Node#parse) now always uses the correct DocumentFragment class. Previously Nokogiri::HTML4::DocumentFragment was always used, even for XML documents. [#1158]
    • DocumentFragment#> now works properly, matching a CSS selector against only the fragment roots. [#1857]
    • XML::DocumentFragment#errors now correctly contains any parsing errors encountered. Previously this was always empty. (Note that HTML::DocumentFragment#errors already did this.)
    • [CRuby] Fix memory leak in Document#canonicalize when inclusive namespaces are passed in. [#2345]
    • [CRuby] Fix memory leak in Document#canonicalize when an argument type error is raised. [#2345]
    • [CRuby] Fix memory leak in EncodingHandler where iconv handlers were not being cleaned up. [#2345]
    • [CRuby] Fix memory leak in XPath custom handlers where string arguments were not being cleaned up. [#2345]
    • [CRuby] Fix memory leak in Reader#base_uri where the string returned by libxml2 was not freed. [#2347]
    • [JRuby] Deleting a Namespace from a NodeSet no longer modifies the href to be the default namespace URL.
    • [JRuby] Fix XHTML formatting of closing tags for non-container elements. [#2355]

    Deprecated

    • Passing a Nokogiri::XML::Node as the second parameter to Node.new is deprecated and will generate a warning. This parameter should be a kind of Nokogiri::XML::Document. This will become an error in a future version of Nokogiri. [#975]
    • Nokogiri::CSS::Parser, Nokogiri::CSS::Tokenizer, and Nokogiri::CSS::Node are now internal-only APIs that are no longer documented, and should not be considered stable. With the introduction of XPathVisitor injection into Nokogiri::CSS.xpath_for there should be no reason to rely on these internal APIs.
    • CSS-to-XPath utility classes Nokogiri::CSS::XPathVisitorAlwaysUseBuiltins and XPathVisitorOptimallyUseBuiltins are deprecated. Prefer Nokogiri::CSS::XPathVisitor with appropriate constructor arguments. These classes will be removed in a future version of Nokogiri.

    SHA256 checksums:

    d147a8feff7faa67de26b152a303a0bbad8ea77ab75e64f4ccf3614b12641dbc  nokogiri-1.13.0-aarch64-linux.gem
    4455dcfedeee00e1b02ddc1df5cf1fc60b72b5bae9ca53d234c85d48b169894e  nokogiri-1.13.0-arm64-darwin.gem
    1a0283e525c74b97cf84d60a842e978d98a00789115e4d528d7784551909ff70  nokogiri-1.13.0-java.gem
    c575d5b22132c78b95279cff259aa21fbb2f185fc7e6967c886138ba2d7286c4  nokogiri-1.13.0-x64-mingw-ucrt.gem
    0607ce088cac95e7bde9d05ad9c5e8b7c342628228bca8302b966c456e9f6160  nokogiri-1.13.0-x64-mingw32.gem
    d313b61192a23793af5b5ca469ec80561933cf4fa958a0106df9dcf031e76077  nokogiri-1.13.0-x86-linux.gem
    dc5f9ee89b297d4f7c1e53de295243b9e6d175d5042960ea5d001eb1b1df1fd7  nokogiri-1.13.0-x86-mingw32.gem
    039372ceb6e5903f70cc5a960a7d141455b2480e0d268234f14bde69347c571c  nokogiri-1.13.0-x86_64-darwin.gem
    03b95ba61c3b7f85d79f99f30e1dd907548dd980e502cdc5eeccfa5db9aafb3b  nokogiri-1.13.0-x86_64-linux.gem
    8dbd691d438dc12dadc3d8b5b7ed0a6e64d84a2d65b392b52dce868fda107db3  nokogiri-1.13.0.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.12.5(Sep 27, 2021)

    1.12.5 / 2021-09-27

    Security

    [JRuby] Address CVE-2021-41098 (GHSA-2rr5-8q37-2w7h).

    In Nokogiri v1.12.4 and earlier, on JRuby only, the SAX parsers resolve external entities (XXE) by default. This fix turns off entity-resolution-by-default in the JRuby SAX parsers to match the CRuby SAX parsers' behavior.

    CRuby users are not affected by this CVE.

    Fixed

    • [CRuby] Document#to_xhtml properly serializes self-closing tags in libxml > 2.9.10. A behavior change introduced in libxml 2.9.11 resulted in emitting start and and tags (e.g., <br></br>) instead of a self-closing tag (e.g., <br/>) in previous Nokogiri versions. [#2324]

    SHA256 checksums:

    36bfa3a07aced069b3f3c9b39d9fb62cb0728d284d02b079404cd55780beaeff  nokogiri-1.12.5-arm64-darwin.gem
    16b1a9ddbb70a9c998462912a5972097cbc79c3e01eb373906886ef8a469f589  nokogiri-1.12.5-java.gem
    218dcc6edd1b49cc6244b5f88afb978739bb2f3f166c271557fe5f51e4bc713c  nokogiri-1.12.5-x64-mingw32.gem
    e33bb919d64c16d931a5f26dc880969e587d225cfa97e6b56e790fb52179f527  nokogiri-1.12.5-x86-linux.gem
    e13c2ed011b8346fbd589e96fe3542d763158bc2c7ad0f4f55f6d801afd1d9ff  nokogiri-1.12.5-x86-mingw32.gem
    1ed64f7db7c1414b87fce28029f2a10128611d2037e0871ba298d00f9a00edd6  nokogiri-1.12.5-x86_64-darwin.gem
    0868c8d0a147904d4dedaaa05af5f06656f2d3c67e4432601718559bf69d6cea  nokogiri-1.12.5-x86_64-linux.gem
    2b20905942acc580697c8c496d0d1672ab617facb9d30d156b3c7676e67902ec  nokogiri-1.12.5.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.12.4(Aug 29, 2021)

    1.12.4 / 2021-08-29

    Notable fix: Namespace inheritance

    Namespace behavior when reparenting nodes has historically been poorly specified and the behavior diverged between CRuby and JRuby. As a result, making this behavior consistent in v1.12.0 introduced a breaking change.

    This patch release reverts the Builder behavior present in v1.12.0..v1.12.3 but keeps the Document behavior. This release also introduces a Document attribute to allow affected users to easily change this behavior for their legacy code without invasive changes.

    Compensating Feature in XML::Document

    This release of Nokogiri introduces a new Document boolean attribute, namespace_inheritance, which controls whether children should inherit a namespace when they are reparented. Nokogiri::XML:Document defaults this attribute to false meaning "do not inherit," thereby making explicit the behavior change introduced in v1.12.0.

    CRuby users who desire the pre-v1.12.0 behavior may set document.namespace_inheritance = true before reparenting nodes.

    See https://nokogiri.org/rdoc/Nokogiri/XML/Document.html#namespace_inheritance-instance_method for example usage.

    Fix for XML::Builder

    However, recognizing that we want Builder-created children to inherit namespaces, Builder now will set namespace_inheritance=true on the underlying document for both JRuby and CRuby. This means that, on CRuby, the pre-v1.12.0 behavior is restored.

    Users who want to turn this behavior off may pass a keyword argument to the Builder constructor like so:

    Nokogiri::XML::Builder.new(namespace_inheritance: false)
    

    See https://nokogiri.org/rdoc/Nokogiri/XML/Builder.html#label-Namespace+inheritance for example usage.

    Downstream gem maintainers

    Note that any downstream gems may want to specifically omit Nokogiri v1.12.0--v1.12.3 from their dependency specification if they rely on child namespace inheritance:

    Gem::Specification.new do |gem|
      # ...
      gem.add_runtime_dependency 'nokogiri', '!=1.12.3', '!=1.12.2', '!=1.12.1', '!=1.12.0'
      # ...
    end
    

    Fixed

    • [JRuby] Fix NPE in Schema parsing when an imported resource doesn't have a systemId. [#2296] (Thanks, @pepijnve!)

    SHA256 checksums:

    892808245fad3dea1bd4405461ba45d8f2261a6e23af91b8fc4b136e37cd3475  nokogiri-1.12.4-arm64-darwin.gem
    1179f2c8fc13f4cb349b4e9219fbe7c1e7b885e24aceb2c8a0e06d1c3fe3ec2a  nokogiri-1.12.4-java.gem
    44e728900a919ca9d8c6a3f545c2ff4903f4f45c47255904548386ad9f9869d6  nokogiri-1.12.4-x64-mingw32.gem
    1116dac823e27f5255024c3154f0db3d2c9008cfdcaf11bbd66bde7770dca12d  nokogiri-1.12.4-x86-linux.gem
    129b372c37dc817b588c623e6899ad32fe166498320789611ae3de0c361166ed  nokogiri-1.12.4-x86-mingw32.gem
    f6f606dbdedd94e85e2fdc5e5829833441962115c3b62a2eab0a51f8ba938c3a  nokogiri-1.12.4-x86_64-darwin.gem
    d706df7ed9382c749382e5b3bd9bfa4986935c0c5e36856d75fd9008d80f4da0  nokogiri-1.12.4-x86_64-linux.gem
    7fec161ee1c7b2329e05fed019bfc7b1f910a39e6b30ae95825e75dda2094de9  nokogiri-1.12.4.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.12.3(Aug 10, 2021)

    1.12.3 / 2021-08-06

    Fixed

    • [CRuby] Fix compilation of libgumbo on older systems with versions of GCC that give errors on C99-isms. Affected systems include RHEL6, RHEL7, and SLES12. [#2302]

    Checksums:

    454eb62fc97285c485279509b04a3dcdcd329d2d0d8040dd6361c331550f3f59  nokogiri-1.12.3-arm64-darwin.gem
    f9c83416f486ab3ea1a1cf58a3337dd3b95c4059350773a95ed2219415aaba8e  nokogiri-1.12.3-java.gem
    a4a21f5e58f1485d3807802aac316c14b017d596f48fe088fd963863b078d34a  nokogiri-1.12.3-x64-mingw32.gem
    9da1fb5436217d94d789ba8936bbb4fa36c8367d0eff43f1c4bbd150a1fe8170  nokogiri-1.12.3-x86-linux.gem
    102e169468cf70b7d7f8719648f9f69f2ef4dfb9e7a59a1392b3c1fcb74e2e88  nokogiri-1.12.3-x86-mingw32.gem
    4ae5202f5b184e5264d282502998846844352c135633c8fd1165ebd4ca2bdef9  nokogiri-1.12.3-x86_64-darwin.gem
    eac6482a21c3cf63fea82a7d48131d701bd305dec01f38374a9c976f772f3b60  nokogiri-1.12.3-x86_64-linux.gem
    d1975e30090ae723e05a6c9bd95fb795527e1a14d53a614735e2c3d8eef1e1e0  nokogiri-1.12.3.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.12.2(Aug 4, 2021)

    1.12.2 / 2021-08-04

    Fixed

    • Ensure that C extension files in non-native gem installations are loaded using require and rely on $LOAD_PATH instead of using require_relative. This issue only exists when deleting shared libraries that exist outside the extensions directory, something users occasionally do to conserve disk space. [#2300]

    Checksums:

    2ef276b482b56cfa488dd24c261c0bf42a47770bd0c15993f5c0d8b61879c114  nokogiri-1.12.2-arm64-darwin.gem
    b483fb44ca38ba5890d53a16ab06e56cb23e6facc861ad1260c7bdf45d8227a2  nokogiri-1.12.2-java.gem
    254e63ce59f95a4c30721d9ec85f8eb5e5e4f61e8da35015e41b85a262c014ea  nokogiri-1.12.2-x64-mingw32.gem
    f66fbeca97668d3b6563d9311fe59b3dda5f7177405ec7a4d9dceca9d8d23b23  nokogiri-1.12.2-x86-linux.gem
    0ece40121d72ab9704e429e06aa2011c7c59112886e000e3dac4ded3f3aeb3d6  nokogiri-1.12.2-x86-mingw32.gem
    b9e33ebbb6c5b7575cfcb69bb52f776541642bbed08c88a36c1a33718458a8b9  nokogiri-1.12.2-x86_64-darwin.gem
    bd8e7eb8345ef0679f2db3afa2bc13d7338b786c51aaa05ac6e22c1c8da3f3b3  nokogiri-1.12.2-x86_64-linux.gem
    94a219a8078bf55f10834445be61b3ad9aa1e1047ec1bed048a86e3ab3245bc5  nokogiri-1.12.2.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.12.1(Aug 3, 2021)

    1.12.1 / 2021-08-03

    Fixed

    • Fix compilation of libgumbo on BSD systems by avoiding GNU-isms. [#2298]

    Checksums:

    194092568135d7897d8df0472c27c82b395a6c09054b8f4e8929805faf9eb877  nokogiri-1.12.1-arm64-darwin.gem
    e9e16b36f6528af16c62bcfaeae517badb1ec07f5e856b5c151a913d3b0e6368  nokogiri-1.12.1-java.gem
    ee1c497c759fdbbe482ab8a0c497b75d44efce5d2ae20fdb93b8c225508dc75a  nokogiri-1.12.1-x64-mingw32.gem
    30c7dff0c9a56a2f03e4e4aa029e14f15282af37d469a0b159446de4c500b28b  nokogiri-1.12.1-x86-linux.gem
    fcbdfc03405624ec0a186fa1bb41111a27264f4e7a7398c64c0d4e1e83769739  nokogiri-1.12.1-x86-mingw32.gem
    ee4c88c46b8797bc6dbeee233ef0862a34d8a1a799e9fdcdfb0dfd8a42bb629b  nokogiri-1.12.1-x86_64-darwin.gem
    f861b04e3268bda45036907f56ceede16b9fe1969099cb8888d378f71706fc63  nokogiri-1.12.1-x86_64-linux.gem
    66dc1f0aa02fc62efb166465dfcc520785068cce4a9a3d2822cdea1f1ce66775  nokogiri-1.12.1.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.12.0(Aug 2, 2021)

    1.12.0 / 2021-08-02

    Notable Addition: HTML5 Support (CRuby only)

    HTML5 support has been added (to CRuby only) by merging Nokogumbo into Nokogiri. The Nokogumbo public API has been preserved, so this functionality is available under the Nokogiri::HTML5 namespace. [#2204]

    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.

    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. 🙌

    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 https://github.com/msys2/MINGW-packages/pull/8957). See #2272 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]

    Fixed

    • [CRuby] Namespaced attributes are handled properly when their parent node is reparented into another document. Previously, the namespace may have gotten dropped. [#2228]
    • [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]

    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.)

    Checksums:

    b0b5650ba7903c317e0ebd4ca67ed10617735719cf3595ad98dd21974404e5d2  nokogiri-1.12.0.gem
    60360d9994bb2e8852deb39f8833ba81a819df921c4192d857323c181645d95e  nokogiri-1.12.0-java.gem
    c439f29de83294e61eca919edfea9d6176f23fa51b23d8a3d7261de6268e5847  nokogiri-1.12.0-x64-mingw32.gem
    89d43ad2ea4f492ebc4c380288077186f0242ccfd65afe14fa0b45529d1f4b5e  nokogiri-1.12.0-x86-mingw32.gem
    20fc8eba21f6e6b82720c05d694d2879ebdf6756351d5d2fb236e93febd346d0  nokogiri-1.12.0-x86-linux.gem
    a21c803d17f89cceda599af1adc139ae17454539276e3f9dbdafea34081b1983  nokogiri-1.12.0-x86_64-linux.gem
    f6b01a013829a499a0bf72a7d5109d117b9d4333823295dcd34eb002be0f0054  nokogiri-1.12.0-arm64-darwin.gem
    97b4260b3912dcfad8427b5ea15ba094790dec1f4725ee074cfc5e9b45906352  nokogiri-1.12.0-x86_64-darwin.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.12.0.rc1(Jul 9, 2021)

    1.12.0.rc1 / 2021-07-09

    Notable Addition: HTML5 Support (CRuby only)

    HTML5 support has been added (to CRuby only) by merging Nokogumbo into Nokogiri. The Nokogumbo public API has been preserved, so this functionality is available under the Nokogiri::HTML5 namespace. [#2204]

    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.

    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. 🙌

    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 https://github.com/msys2/MINGW-packages/pull/8957). See #2272 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]

    Fixed

    • [CRuby] Namespaced attributes are handled properly when their parent node is reparented into another document. Previously, the namespace may have gotten dropped. [#2228]
    • [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]

    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.)

    Checksums:

    cb38e1023d5e1b6a33a1b5c7659b68ce7c88449eb69430db128d4d53731b1638  gems/nokogiri-1.12.0.rc1.gem
    b5e8e912013cc73e78a1817c5b131cdbc3e224dd4c3158063b562f0a89cb9adb  gems/nokogiri-1.12.0.rc1-java.gem
    598b9ed6b98fea43dfc74dbd0cbe24994a26fb1e3dff1a727ba79392495d40d5  gems/nokogiri-1.12.0.rc1-x64-mingw32.gem
    7a11a5d911d98a8ddc6a88e712aae82a953fe291f9bb150d4cfe34539489792a  gems/nokogiri-1.12.0.rc1-x86-mingw32.gem
    41ace0fcff1901a8d6661cac815fa573d934d9e8280e21e2ec16dd1bd3a6ff7a  gems/nokogiri-1.12.0.rc1-x86-linux.gem
    5843752b3d989954ace6fee40ba0634c615b8c579f885c70ff067a8fcc62fa69  gems/nokogiri-1.12.0.rc1-x86_64-linux.gem
    8e0ecef0dd76a640f4e1ba4dd9b5df8c5ee352ec944ad7f6beedb89c0b49bfcb  gems/nokogiri-1.12.0.rc1-arm64-darwin.gem
    ae56204ca3d8154c46c9fc55f526ff8a71b9a3f4bc879dca26674f4714d7dff6  gems/nokogiri-1.12.0.rc1-x86_64-darwin.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.11.7(Jun 3, 2021)

    1.11.7 / 2021-06-02

    • [CRuby] Backporting an upstream fix to XPath recursion depth limits which impacted some users of complex XPath queries. This issue is present in libxml 2.9.11 and 2.9.12. [#2257]

    Checksums

    SHA256:

    4976a9c9e796527d51dc6c311b9bd93a0233f6a7962a0f569aa5c782461836ef  nokogiri-1.11.7.gem
    9d69f57f6c024d86e358a8aef7a273f574721e48a6b2e1426cca007827325413  nokogiri-1.11.7-java.gem
    6017dee25feb80292b04554cc1bf8a0a2ede3b6c3daeac811902157bbc6a3bdc  nokogiri-1.11.7-x64-mingw32.gem
    38892350c1e695eab9bd77483300d681c32a22714d0e2d04d10a4c343b424bdd  nokogiri-1.11.7-x86-mingw32.gem
    1d15603cd878fa2b710a3ba3028a99d9dd0c14b75711faebf9fb6ff40bac3880  nokogiri-1.11.7-x86-linux.gem
    7ad9741e7a2fee1ffb4a4b2e20b00e87992c9efd969f557ca3b83fb2653b9bfc  nokogiri-1.11.7-x86_64-linux.gem
    c93d66d9413ea7c37d30f95e2c54606fec638e556d454e08124d9a33b7fa82c8  nokogiri-1.11.7-arm64-darwin.gem
    8761d9c7baacb26546869ed56dbc78d3eb3cabf49b85d91b1cd827cd6e94fb25  nokogiri-1.11.7-x86_64-darwin.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.11.6(May 26, 2021)

    1.11.6 / 2021-05-26

    Fixed

    • [CRuby] DocumentFragment#path now does proper error-checking to handle behavior introduced in libxml > 2.9.10. In v1.11.4 and v1.11.5, calling DocumentFragment#path could result in a segfault.
    Source code(tar.gz)
    Source code(zip)
  • v1.11.5(May 20, 2021)

    1.11.5 / 2021-05-19

    Fixed

    [Windows CRuby] Work around segfault at process exit on Windows when using libxml2 system DLLs.

    libxml 2.9.12 introduced new behavior to avoid memory leaks when unloading libxml2 shared libraries (see libxml/!66). Early testing caught this segfault on non-Windows platforms (see #2059 and libxml@956534e) but it was incompletely fixed and is still an issue on Windows platforms that are using system DLLs.

    We work around this by configuring libxml2 in this situation to use its default memory management functions. Note that if Nokogiri is not on Windows, or is not using shared system libraries, it will will continue to configure libxml2 to use Ruby's memory management functions. Nokogiri::VERSION_INFO["libxml"]["memory_management"] will allow you to verify when the default memory management functions are being used. [#2241]

    Added

    Nokogiri::VERSION_INFO["libxml"] now contains the key "memory_management" to declare whether libxml2 is using its default memory management functions, or whether it uses the memory management functions from ruby. See above for more details.

    Source code(tar.gz)
    Source code(zip)
  • v1.11.4(May 14, 2021)

    1.11.4 / 2021-05-14

    Security

    [CRuby] Vendored libxml2 upgraded to v2.9.12 which addresses:

    Note that two additional CVEs were addressed upstream but are not relevant to this release. CVE-2021-3516 via xmllint is not present in Nokogiri, and CVE-2020-7595 has been patched in Nokogiri since v1.10.8 (see #1992).

    Please see nokogiri/GHSA-7rrm-v45f-jp64 or #2233 for a more complete analysis of these CVEs and patches.

    Dependencies

    • [CRuby] vendored libxml2 is updated from 2.9.10 to 2.9.12. (Note that 2.9.11 was skipped because it was superseded by 2.9.12 a few hours after its release.)
    Source code(tar.gz)
    Source code(zip)
  • v1.11.3(Apr 7, 2021)

    1.11.3 / 2021-04-07

    Fixed

    • [CRuby] Passing non-Node objects to Document#root= now raises an ArgumentError exception. Previously this likely segfaulted. [#1900]
    • [JRuby] Passing non-Node objects to Document#root= now raises an ArgumentError exception. Previously this raised a TypeError exception.
    • [CRuby] arm64/aarch64 systems (like Apple's M1) can now compile libxml2 and libxslt from source (though we continue to strongly advise users to install the native gems for the best possible experience)
    Source code(tar.gz)
    Source code(zip)
  • v1.11.2(Mar 11, 2021)

    1.11.2 / 2021-03-11

    Fixed

    • [CRuby] NodeSet may now safely contain Node objects from multiple documents. Previously the GC lifecycle of the parent Document objects could lead to nodes being GCed while still in scope. [#1952]
    • [CRuby] Patch libxml2 to avoid "huge input lookup" errors on large CDATA elements. (See upstream GNOME/libxml2#200 and GNOME/libxml2!100.) [#2132].
    • [CRuby+Windows] Enable Nokogumbo (and other downstream gems) to compile and link against nokogiri.so by including LDFLAGS in Nokogiri::VERSION_INFO. [#2167]
    • [CRuby] {XML,HTML}::Document.parse now invokes #initialize exactly once. Previously #initialize was invoked twice on each object.
    • [JRuby] {XML,HTML}::Document.parse now invokes #initialize exactly once. Previously #initialize was not called, which was a problem for subclassing such as done by Loofah.

    Improved

    • Reduce the number of object allocations needed when parsing an HTML::DocumentFragment. [#2087] (Thanks, @ashmaroli!)
    • [JRuby] Update the algorithm used to calculate Node#line to be wrong less-often. The underlying parser, Xerces, does not track line numbers, and so we've always used a hacky solution for this method. [#1223, #2177]
    • Introduce --enable-system-libraries and --disable-system-libraries flags to extconf.rb. These flags provide the same functionality as --use-system-libraries and the NOKOGIRI_USE_SYSTEM_LIBRARIES environment variable, but are more idiomatic. [#2193] (Thanks, @eregon!)
    • [TruffleRuby] --disable-static is now the default on TruffleRuby when the packaged libraries are used. This is more flexible and compiles faster. (Note, though, that the default on TR is still to use system libraries.) [#2191, #2193] (Thanks, @eregon!)

    Changed

    • Nokogiri::XML::Path is now a Module (previously it has been a Class). It has been acting solely as a Module since v1.0.0. See 8461c74.
    Source code(tar.gz)
    Source code(zip)
  • v1.11.1(Jan 6, 2021)

    v1.11.1 / 2021-01-06

    Fixed

    • [CRuby] If libxml-ruby is loaded before nokogiri, the SAX and Push parsers no longer call libxml-ruby's handlers. Instead, they defensively override the libxml2 global handler before parsing. [#2168]

    SHA-256 Checksums of published gems

    a41091292992cb99be1b53927e1de4abe5912742ded956b0ba3383ce4f29711c  nokogiri-1.11.1-arm64-darwin.gem
    d44fccb8475394eb71f29dfa7bb3ac32ee50795972c4557ffe54122ce486479d  nokogiri-1.11.1-java.gem
    f760285e3db732ee0d6e06370f89407f656d5181a55329271760e82658b4c3fc  nokogiri-1.11.1-x64-mingw32.gem
    dd48343bc4628936d371ba7256c4f74513b6fa642e553ad7401ce0d9b8d26e1f  nokogiri-1.11.1-x86-linux.gem
    7f49138821d714fe2c5d040dda4af24199ae207960bf6aad4a61483f896bb046  nokogiri-1.11.1-x86-mingw32.gem
    5c26111f7f26831508cc5234e273afd93f43fbbfd0dcae5394490038b88d28e7  nokogiri-1.11.1-x86_64-darwin.gem
    c3617c0680af1dd9fda5c0fd7d72a0da68b422c0c0b4cebcd7c45ff5082ea6d2  nokogiri-1.11.1-x86_64-linux.gem
    42c2a54dd3ef03ef2543177bee3b5308313214e99f0d1aa85f984324329e5caa  nokogiri-1.11.1.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.11.0(Jan 4, 2021)

    v1.11.0 / 2021-01-03

    Notes

    Faster, more reliable installation: Native Gems for Linux and OSX/Darwin

    "Native gems" contain pre-compiled libraries for a specific machine architecture. On supported platforms, this removes the need for compiling the C extension and the packaged libraries. This results in much faster installation and more reliable installation, which as you probably know are the biggest headaches for Nokogiri users.

    We've been shipping native Windows gems since 2009, but starting in v1.11.0 we are also shipping native gems for these platforms:

    • Linux: x86-linux and x86_64-linux -- including musl platforms like alpine
    • OSX/Darwin: x86_64-darwin and arm64-darwin

    We'd appreciate your thoughts and feedback on this work at #2075.

    Dependencies

    Ruby

    This release introduces support for Ruby 2.7 and 3.0 in the precompiled native gems.

    This release ends support for:

    Gems

    • Explicitly add racc as a runtime dependency. [#1988] (Thanks, @voxik!)
    • [MRI] Upgrade mini_portile2 dependency from ~> 2.4.0 to ~> 2.5.0 [#2005] (Thanks, @alejandroperea!)

    Security

    See note below about CVE-2020-26247 in the "Changed" subsection entitled "XML::Schema parsing treats input as untrusted by default".

    Added

    • Add Node methods for manipulating "keyword attributes" (for example, class and rel): #kwattr_values, #kwattr_add, #kwattr_append, and #kwattr_remove. [#2000]
    • Add support for CSS queries a:has(> b), a:has(~ b), and a:has(+ b). [#688] (Thanks, @jonathanhefner!)
    • Add Node#value? to better match expected semantics of a Hash-like object. [#1838, #1840] (Thanks, @MatzFan!)
    • [CRuby] Add Nokogiri::XML::Node#line= for use by downstream libs like nokogumbo. [#1918] (Thanks, @stevecheckoway!)
    • nokogiri.gemspec is back after a 10-year hiatus. We still prefer you use the official releases, but master is pretty stable these days, and YOLO.

    Performance

    • [CRuby] The CSS ~= operator and class selector . are about 2x faster. [#2137, #2135]
    • [CRuby] Patch libxml2 to call strlen from xmlStrlen rather than the naive implementation, because strlen is generally optimized for the architecture. [#2144] (Thanks, @ilyazub!)
    • Improve performance of some namespace operations. [#1916] (Thanks, @ashmaroli!)
    • Remove unnecessary array allocations from Node serialization methods [#1911] (Thanks, @ashmaroli!)
    • Avoid creation of unnecessary zero-length String objects. [#1970] (Thanks, @ashmaroli!)
    • Always compile libxml2 and libxslt with '-O2' [#2022, #2100] (Thanks, @ilyazub!)
    • [JRuby] Lots of code cleanup and performance improvements. [#1934] (Thanks, @kares!)
    • [CRuby] RelaxNG.from_document no longer leaks memory. [#2114]

    Improved

    • [CRuby] Handle incorrectly-closed HTML comments as WHATWG recommends for browsers. [#2058] (Thanks to HackerOne user mayflower for reporting this!)
    • {HTML,XML}::Document#parse now accept Pathname objects. Previously this worked only if the referenced file was less than 4096 bytes long; longer files resulted in undefined behavior because the read method would be repeatedly invoked. [#1821, #2110] (Thanks, @doriantaylor and @phokz!)
    • [CRuby] Nokogumbo builds faster because it can now use header files provided by Nokogiri. [#1788] (Thanks, @stevecheckoway!)
    • Add frozen_string_literal: true magic comment to all lib files. [#1745] (Thanks, @oniofchaos!)
    • [JRuby] Clean up deprecated calls into JRuby. [#2027] (Thanks, @headius!)

    Fixed

    • HTML Parsing in "strict" mode (i.e., the RECOVER parse option not set) now correctly raises a XML::SyntaxError exception. Previously the value of the RECOVER bit was being ignored by CRuby and was misinterpreted by JRuby. [#2130]
    • The CSS ~= operator now correctly handles non-space whitespace in the class attribute. commit e45dedd
    • The switch to turn off the CSS-to-XPath cache is now thread-local, rather than being shared mutable state. [#1935]
    • The Node methods add_previous_sibling, previous=, before, add_next_sibling, next=, after, replace, and swap now correctly use their parent as the context node for parsing markup. These methods now also raise a RuntimeError if they are called on a node with no parent. [nokogumbo#160]
    • [JRuby] XML::Schema XSD validation errors are captured in XML::Schema#errors. These errors were previously ignored.
    • [JRuby] Standardize reading from IO like objects, including StringIO. [#1888, #1897]
    • [JRuby] Fix how custom XPath function namespaces are inferred to be less naive. [#1890, #2148]
    • [JRuby] Clarify exception message when custom XPath functions can't be resolved.
    • [JRuby] Comparison of Node to Document with Node#<=> now matches CRuby/libxml2 behavior.
    • [CRuby] Syntax errors are now correctly captured in Document#errors for short HTML documents. Previously the SAX parser used for encoding detection was clobbering libxml2's global error handler.
    • [CRuby] Fixed installation on AIX with respect to vasprintf. [#1908]
    • [CRuby] On some platforms, avoid symbol name collision with glibc's canonicalize. [#2105]
    • [Windows Visual C++] Fixed compiler warnings and errors. [#2061, #2068]
    • [CRuby] Fixed Nokogumbo integration which broke in the v1.11.0 release candidates. [#1788] (Thanks, @stevecheckoway!)
    • [JRuby] Fixed document encoding regression in v1.11.0 release candidates. [#2080, #2083] (Thanks, @thbar!)

    Removed

    • The internal method Nokogiri::CSS::Parser.cache_on= has been removed. Use .set_cache if you need to muck with the cache internals.
    • The class method Nokogiri::CSS::Parser.parse has been removed. This was originally deprecated in 2009 in 13db61b. Use Nokogiri::CSS.parse instead.

    Changed

    XML::Schema input is now "untrusted" by default

    Address CVE-2020-26247.

    In Nokogiri versions <= 1.11.0.rc3, XML Schemas parsed by Nokogiri::XML::Schema were trusted by default, allowing external resources to be accessed over the network, potentially enabling XXE or SSRF attacks.

    This behavior is counter to the security policy intended by Nokogiri maintainers, which is to treat all input as untrusted by default whenever possible.

    Please note that this security fix was pushed into a new minor version, 1.11.x, rather than a patch release to the 1.10.x branch, because it is a breaking change for some schemas and the risk was assessed to be "Low Severity".

    More information and instructions for enabling "trusted input" behavior in v1.11.0.rc4 and later is available at the public advisory.

    HTML parser now obeys the strict or norecover parsing option

    (Also noted above in the "Fixed" section) HTML Parsing in "strict" mode (i.e., the RECOVER parse option not set) now correctly raises a XML::SyntaxError exception. Previously the value of the RECOVER bit was being ignored by CRuby and was misinterpreted by JRuby.

    If you're using the default parser options, you will be unaffected by this fix. If you're passing strict or norecover to your HTML parser call, you may be surprised to see that the parser now fails to recover and raises a XML::SyntaxError exception. Given the number of HTML documents on the internet that libxml2 would consider to be ill-formed, this is probably not what you want, and you can omit setting that parse option to restore the behavior that you have been relying upon.

    Apologies to anyone inconvenienced by this breaking bugfix being present in a minor release, but I felt it was appropriate to introduce this fix because it's straightforward to fix any code that has been relying on this buggy behavior.

    VersionInfo, the output of nokogiri -v, and related constants

    This release changes the metadata provided in Nokogiri::VersionInfo which also affects the output of nokogiri -v. Some related constants have also been changed. If you're using VersionInfo programmatically, or relying on constants related to underlying library versions, please read the detailed changes for Nokogiri::VersionInfo at #2139 and accept our apologies for the inconvenience.

    SHA-256 Checksums of published gems

    17ed2567bf76319075b4a6a7258d1a4c9e2661fca933b03e037d79ae2b9910d0  nokogiri-1.11.0.gem
    2f0149c735b0672c49171b18467ce25fd323a8e608c9e6b76e2b2fa28e7f66ee  nokogiri-1.11.0-java.gem
    2f249be8cc705f9e899c07225fcbe18f4f7dea220a59eb5fa82461979991082e  nokogiri-1.11.0-x64-mingw32.gem
    9e219401dc3f93abf09166d12ed99c8310fcaf8c56a99d64ff93d8b5f0604e91  nokogiri-1.11.0-x86-mingw32.gem
    bda2a9c9debf51da7011830c7f2dc5771c122ebcf0fc2dd2c4ba4fc95b5c38f2  nokogiri-1.11.0-x86-linux.gem
    d500c3202e2514b32f4b02049d9193aa825ae3e9442c9cad2d235446c3e17d8d  nokogiri-1.11.0-x86_64-linux.gem
    3a613188e3b76d593b04e0ddcc46f44c288b13f80b32ce83957356f50e22f9ee  nokogiri-1.11.0-arm64-darwin.gem
    b8f9b826d09494b20b30ecd048f5eb2827dccd85b77abeb8baf1f610e5ed28ed  nokogiri-1.11.0-x86_64-darwin.gem
    
    Source code(tar.gz)
    Source code(zip)
  • v1.11.0.rc4(Dec 29, 2020)

    v1.11.0.rc4 / 2020-12-29

    Latest is v1.11.0.rc4 (2020-12-29). To try out release candidates, use gem install --prerelease or gem install nokogiri -v1.11.0.rc4

    If you're using bundler, try updating your Gemfile with:

    gem "nokogiri", "~> 1.11.0.rc4"`
    

    Delta since v1.11.0.rc3:

    Notes

    • Added precompiled native gem support for Darwin (OSX) platform arm64-darwin

    Dependencies

    Ruby

    Gems

    • Explicitly add racc as a runtime dependency. [#1988] (Thanks, @voxik!)

    Security

    See note below about CVE-2020-26247 in the "Changed" subsection entitled "XML::Schema parsing treats input as untrusted by default".

    Performance

    • [CRuby] The CSS ~= operator and class selector . are about 2x faster. [#2137, #2135]
    • [CRuby] Patch libxml2 to call strlen from xmlStrlen rather than the naive implementation, because strlen is generally optimized for the architecture. [#2144] (Thanks, @ilyazub!)
    • Always compile libxml2 and libxslt with '-O2' [#2022, #2100] (Thanks, @ilyazub!)
    • [CRuby] RelaxNG.from_document no longer leaks memory. [#2114]

    Improved

    • [CRuby] Handle incorrectly-closed HTML comments as WHATWG recommends for browsers. [#2058] (Thanks to HackerOne user mayflower for reporting this!)
    • {HTML,XML}::Document#parse now accept Pathname objects. Previously this worked only if the referenced file was less than 4096 bytes long; longer files resulted in undefined behavior because the read method would be repeatedly invoked. [#1821, #2110] (Thanks, @doriantaylor and @phokz!)
    • [CRuby] Nokogumbo builds faster because it can now use header files provided by Nokogiri. [#1788] (Thanks, @stevecheckoway!)
    • [JRuby] Clean up deprecated calls into JRuby. [#2027] (Thanks, @headius!)

    Fixed

    • HTML Parsing in "strict" mode (i.e., the RECOVER parse option not set) now correctly raises a XML::SyntaxError exception. Previously the value of the RECOVER bit was being ignored by CRuby and was misinterpreted by JRuby. [#2130]
    • The CSS ~= operator now correctly handles non-space whitespace in the class attribute. commit e45dedd
    • The Node methods add_previous_sibling, previous=, before, add_next_sibling, next=, after, replace, and swap now correctly use their parent as the context node for parsing markup. These methods now also raise a RuntimeError if they are called on a node with no parent. [nokogumbo#160]
    • [JRuby] XML::Schema XSD validation errors are captured in XML::Schema#errors. These errors were previously ignored.
    • [JRuby] Fix how custom XPath function namespaces are inferred to be less naive. [#1890, #2148]
    • [JRuby] Clarify exception message when custom XPath functions can't be resolved.
    • [JRuby] Comparison of Node to Document with Node#<=> now matches CRuby/libxml2 behavior.
    • [CRuby] Syntax errors are now correctly captured in Document#errors for short HTML documents. Previously the SAX parser used for encoding detection was clobbering libxml2's global error handler.
    • [CRuby] On some platforms, avoid symbol name collision with glibc's canonicalize. [#2105]
    • [CRuby] Fixed Nokogumbo integration which broke in the v1.11.0 release candidates. [#1788] (Thanks, @stevecheckoway!)
    • [JRuby] Fixed document encoding regression in v1.11.0 release candidates. [#2080, #2083] (Thanks, @thbar!)

    Changed

    XML::Schema input is now "untrusted" by default

    Address CVE-2020-26247.

    In Nokogiri versions <= 1.11.0.rc3, XML Schemas parsed by Nokogiri::XML::Schema were trusted by default, allowing external resources to be accessed over the network, potentially enabling XXE or SSRF attacks.

    This behavior is counter to the security policy intended by Nokogiri maintainers, which is to treat all input as untrusted by default whenever possible.

    Please note that this security fix was pushed into a new minor version, 1.11.x, rather than a patch release to the 1.10.x branch, because it is a breaking change for some schemas and the risk was assessed to be "Low Severity".

    More information and instructions for enabling "trusted input" behavior in v1.11.0.rc4 and later is available at the public advisory.

    HTML parser now obeys the strict or norecover parsing option

    (Also noted above in the "Fixed" section) HTML Parsing in "strict" mode (i.e., the RECOVER parse option not set) now correctly raises a XML::SyntaxError exception. Previously the value of the RECOVER bit was being ignored by CRuby and was misinterpreted by JRuby.

    If you're using the default parser options, you will be unaffected by this fix. If you're passing strict or norecover to your HTML parser call, you may be surprised to see that the parser now fails to recover and raises a XML::SyntaxError exception. Given the number of HTML documents on the internet that libxml2 would consider to be ill-formed, this is probably not what you want, and you can omit setting that parse option to restore the behavior that you have been relying upon.

    Apologies to anyone inconvenienced by this breaking bugfix being present in a minor release, but I felt it was appropriate to introduce this fix because it's straightforward to fix any code that has been relying on this buggy behavior.

    VersionInfo, the output of nokogiri -v, and related constants

    This release changes the metadata provided in Nokogiri::VersionInfo which also affects the output of nokogiri -v. Some related constants have also been changed. If you're using VersionInfo programmatically, or relying on constants related to underlying library versions, please read the detailed changes for Nokogiri::VersionInfo at #2139 and accept our apologies for the inconvenience.

    Source code(tar.gz)
    Source code(zip)
  • v1.11.0.rc3(Sep 8, 2020)

    v1.11.0.rc3 / 2020-09-08

    To try out release candidates, use gem install --prerelease or gem install nokogiri -v1.11.0.rc3

    If you're using bundler, try updating your Gemfile with:

    gem "nokogiri", "~> 1.11.0.rc3"`
    

    Delta since v1.11.0.rc2:

    Notes

    Added precompiled native gem support for OSX/Darwin platform x86_64-darwin19.

    Fixed

    • [Windows Visual C++] Fixed compiler warnings and errors. [#2061, #2068]
    Source code(tar.gz)
    Source code(zip)
  • v1.10.10(Jul 6, 2020)

    1.10.10 / 2020-07-06

    Features

    • [MRI] Cross-built Windows gems now support Ruby 2.7 [#2029]. Note that prior to this release, the v1.11.x prereleases provided this support.
    Source code(tar.gz)
    Source code(zip)
Owner
Sparkle Motion
Sparkle Motion
Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful.

Please see https://repo1.maven.org/maven2/org/parboiled/ for download access to the artifacts https://github.com/sirthias/parboiled/wiki for all docum

Mathias 1.2k Dec 21, 2022
Apache Nutch is an extensible and scalable web crawler

Apache Nutch README For the latest information about Nutch, please visit our website at: https://nutch.apache.org/ and our wiki, at: https://cwiki.apa

The Apache Software Foundation 2.5k Dec 31, 2022
uniVocity-parsers is a suite of extremely fast and reliable parsers for Java. It provides a consistent interface for handling different file formats, and a solid framework for the development of new parsers.

Welcome to univocity-parsers univocity-parsers is a collection of extremely fast and reliable parsers for Java. It provides a consistent interface for

univocity 874 Dec 15, 2022
CSS keyframe animation for JavaFX. Create animations like you would do with CSS.

JFXAnimation CSS keyframe animation for JavaFX. If you are using JFoenix JFXAnimation is included (currently version 1.0.0 only) Requirements JDK 8 an

Marcel Schlegel 49 Dec 28, 2022
Student management system with sql database,Jsp & Java (Front end with HTML & CSS)

studentmanagementsystem Student management system with sql database,Jsp & Java (Front end with HTML & CSS) what this basically is that it integrates t

Isaac 7 Oct 3, 2022
jsoup: the Java HTML parser, built for HTML editing, cleaning, scraping, and XSS safety.

jsoup: Java HTML Parser jsoup is a Java library for working with real-world HTML. It provides a very convenient API for fetching URLs and extracting a

Jonathan Hedley 9.9k Jan 4, 2023
hella-html is a library that makes it hella easy to generate dynamic HTML in vanilla Java.

Hella easy HTML in Java hella-html is a library that makes it hella easy to generate dynamic HTML in vanilla Java. Very lightweight and fast, the prim

null 1 Nov 23, 2022
An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!

OPEN HTML TO PDF OVERVIEW Open HTML to PDF is a pure-Java library for rendering arbitrary well-formed XML/XHTML (and even HTML5) using CSS 2.1 for lay

null 1.6k Dec 29, 2022
XML/XHTML and CSS 2.1 renderer in pure Java

Flying Saucer OVERVIEW Flying Saucer is a pure-Java library for rendering arbitrary well-formed XML (or XHTML) using CSS 2.1 for layout and formatting

null 1.8k Jan 2, 2023
An extensible Java framework for building XML and non-XML streaming applications

Smooks Framework This is the Git source code repository for the Smooks Project. Build Status Building Pre-requisites JDK 8 Apache Maven 3.2.x Maven gi

Smooks Framework 353 Dec 1, 2022
A well-designed local image and video selector for Android

Matisse Matisse is a well-designed local image and video selector for Android. You can Use it in Activity or Fragment Select images including JPEG, PN

Zhihu 12.4k Dec 29, 2022
HubCore - Lobby Plugin for Nukkit with Server Selector, Gadgets, and Friends , Parties!

HubCore HubCore is an in-Development Lobby Plugin for Nukkit and PowerNukkit supporting API Versions through 1.0.9 to 1.0.13 It is highly configurable

OP Heroes Development Team 1 Jan 4, 2022
High performance CSV reader and writer for Java.

FastCSV ?? FastCSV 2.0 upgrade has landed with major improvements on performance and usability! FastCSV is an ultra-fast and dependency-free RFC 4180

Oliver Siegmar 411 Dec 22, 2022
An efficient, up-to-date reader/writer for Java properties files

JProperties JProperties is a small, highly efficient, and extensible library for parsing .properties files. It is a modern replacement for the java.ut

Aidan 12 Apr 1, 2022
Metrobank CSV file reader.

BankTransactionReader The application reads an input CSV file with bank transactions and computes total income and expenses for the whole file, presen

Elza Contiero 0 Sep 1, 2022
JavaCC - a parser generator for building parsers from grammars. It can generate code in Java, C++ and C#.

JavaCC Java Compiler Compiler (JavaCC) is the most popular parser generator for use with Java applications. A parser generator is a tool that reads a

null 971 Dec 27, 2022
Write parsers for arbitrary text inputs, entirely in Java, with no preprocessing phase

Read me first The license of this project is Apache 2.0. Requires Java 7 or later. The latest versions are: development: 2.1.0-beta.3; requires Java 8

Francis Galiegue 62 Oct 13, 2022
Build parsers in Java

jparsec Builds mini parsers in pure Java. Latest version: 3.0 (requires Java 8+) News 2016-12-05 Removed references to Codehaus in copyright and packa

null 324 Dec 31, 2022
These samples explore the different options that Spring Boot developers have for using Javascript and CSS on the client (browser) side of their application.

Table of Contents Getting Started Narrowing the Choices Create a New Application Webjars Show Me Some Javascript Normalizing Resource Paths Adding Tab

Dave Syer 18 Jul 29, 2022