nokogiri 1.15.3 → 1.18.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -17
  3. data/LICENSE-DEPENDENCIES.md +6 -6
  4. data/README.md +11 -5
  5. data/dependencies.yml +9 -8
  6. data/ext/nokogiri/extconf.rb +191 -154
  7. data/ext/nokogiri/gumbo.c +69 -53
  8. data/ext/nokogiri/html4_document.c +10 -4
  9. data/ext/nokogiri/html4_element_description.c +18 -18
  10. data/ext/nokogiri/html4_sax_parser.c +40 -0
  11. data/ext/nokogiri/html4_sax_parser_context.c +48 -58
  12. data/ext/nokogiri/html4_sax_push_parser.c +26 -25
  13. data/ext/nokogiri/libxml2_polyfill.c +114 -0
  14. data/ext/nokogiri/nokogiri.c +9 -2
  15. data/ext/nokogiri/nokogiri.h +25 -33
  16. data/ext/nokogiri/test_global_handlers.c +1 -1
  17. data/ext/nokogiri/xml_attr.c +1 -1
  18. data/ext/nokogiri/xml_cdata.c +3 -12
  19. data/ext/nokogiri/xml_comment.c +3 -8
  20. data/ext/nokogiri/xml_document.c +173 -158
  21. data/ext/nokogiri/xml_document_fragment.c +10 -25
  22. data/ext/nokogiri/xml_dtd.c +1 -1
  23. data/ext/nokogiri/xml_element_content.c +9 -9
  24. data/ext/nokogiri/xml_encoding_handler.c +4 -4
  25. data/ext/nokogiri/xml_namespace.c +6 -10
  26. data/ext/nokogiri/xml_node.c +142 -108
  27. data/ext/nokogiri/xml_node_set.c +46 -44
  28. data/ext/nokogiri/xml_reader.c +74 -100
  29. data/ext/nokogiri/xml_relax_ng.c +35 -56
  30. data/ext/nokogiri/xml_sax_parser.c +156 -88
  31. data/ext/nokogiri/xml_sax_parser_context.c +220 -128
  32. data/ext/nokogiri/xml_sax_push_parser.c +69 -50
  33. data/ext/nokogiri/xml_schema.c +51 -87
  34. data/ext/nokogiri/xml_syntax_error.c +19 -11
  35. data/ext/nokogiri/xml_text.c +3 -6
  36. data/ext/nokogiri/xml_xpath_context.c +104 -104
  37. data/ext/nokogiri/xslt_stylesheet.c +16 -11
  38. data/gumbo-parser/Makefile +18 -0
  39. data/gumbo-parser/src/ascii.c +2 -2
  40. data/gumbo-parser/src/error.c +76 -48
  41. data/gumbo-parser/src/error.h +5 -1
  42. data/gumbo-parser/src/nokogiri_gumbo.h +11 -2
  43. data/gumbo-parser/src/parser.c +66 -25
  44. data/gumbo-parser/src/tokenizer.c +7 -6
  45. data/lib/nokogiri/class_resolver.rb +1 -1
  46. data/lib/nokogiri/css/node.rb +6 -2
  47. data/lib/nokogiri/css/parser.rb +6 -4
  48. data/lib/nokogiri/css/parser.y +2 -2
  49. data/lib/nokogiri/css/parser_extras.rb +6 -66
  50. data/lib/nokogiri/css/selector_cache.rb +38 -0
  51. data/lib/nokogiri/css/tokenizer.rb +4 -4
  52. data/lib/nokogiri/css/tokenizer.rex +9 -8
  53. data/lib/nokogiri/css/xpath_visitor.rb +44 -27
  54. data/lib/nokogiri/css.rb +86 -20
  55. data/lib/nokogiri/decorators/slop.rb +3 -5
  56. data/lib/nokogiri/encoding_handler.rb +2 -2
  57. data/lib/nokogiri/html4/document.rb +45 -24
  58. data/lib/nokogiri/html4/document_fragment.rb +124 -12
  59. data/lib/nokogiri/html4/encoding_reader.rb +2 -2
  60. data/lib/nokogiri/html4/sax/parser.rb +23 -38
  61. data/lib/nokogiri/html4/sax/parser_context.rb +4 -9
  62. data/lib/nokogiri/html4.rb +9 -14
  63. data/lib/nokogiri/html5/builder.rb +40 -0
  64. data/lib/nokogiri/html5/document.rb +61 -30
  65. data/lib/nokogiri/html5/document_fragment.rb +130 -20
  66. data/lib/nokogiri/html5/node.rb +4 -4
  67. data/lib/nokogiri/html5.rb +114 -138
  68. data/lib/nokogiri/version/constant.rb +1 -1
  69. data/lib/nokogiri/version/info.rb +6 -5
  70. data/lib/nokogiri/xml/attr.rb +2 -2
  71. data/lib/nokogiri/xml/builder.rb +8 -1
  72. data/lib/nokogiri/xml/document.rb +74 -31
  73. data/lib/nokogiri/xml/document_fragment.rb +86 -15
  74. data/lib/nokogiri/xml/namespace.rb +1 -2
  75. data/lib/nokogiri/xml/node.rb +113 -35
  76. data/lib/nokogiri/xml/node_set.rb +12 -10
  77. data/lib/nokogiri/xml/parse_options.rb +1 -1
  78. data/lib/nokogiri/xml/pp/node.rb +6 -1
  79. data/lib/nokogiri/xml/reader.rb +51 -17
  80. data/lib/nokogiri/xml/relax_ng.rb +57 -20
  81. data/lib/nokogiri/xml/sax/document.rb +174 -83
  82. data/lib/nokogiri/xml/sax/parser.rb +115 -41
  83. data/lib/nokogiri/xml/sax/parser_context.rb +116 -8
  84. data/lib/nokogiri/xml/sax/push_parser.rb +3 -0
  85. data/lib/nokogiri/xml/sax.rb +48 -0
  86. data/lib/nokogiri/xml/schema.rb +112 -45
  87. data/lib/nokogiri/xml/searchable.rb +39 -43
  88. data/lib/nokogiri/xml/syntax_error.rb +23 -1
  89. data/lib/nokogiri/xml/xpath_context.rb +14 -3
  90. data/lib/nokogiri/xml.rb +14 -25
  91. data/lib/nokogiri/xslt/stylesheet.rb +29 -7
  92. data/lib/nokogiri/xslt.rb +4 -10
  93. data/lib/nokogiri.rb +1 -1
  94. data/lib/xsd/xmlparser/nokogiri.rb +3 -4
  95. data/patches/libxml2/0019-xpath-Use-separate-static-hash-table-for-standard-fu.patch +244 -0
  96. data/ports/archives/libxml2-2.13.7.tar.xz +0 -0
  97. data/ports/archives/libxslt-1.1.43.tar.xz +0 -0
  98. metadata +13 -14
  99. data/ext/nokogiri/libxml2_backwards_compat.c +0 -121
  100. data/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch +0 -25
  101. data/ports/archives/libxml2-2.11.4.tar.xz +0 -0
  102. data/ports/archives/libxslt-1.1.38.tar.xz +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c52a7557a0ff635d8635257504bf1d3f8832995dfdb8b9a91645b20ecb71c7a
4
- data.tar.gz: b217b18d1ebc0f8d6e0a91e13bafdfc024c7dea9af4978124819a06d9f6c8228
3
+ metadata.gz: e8955e1010e2fd456ffa2ffc7d14808ccb539b0e0190d2e5d5389b2d52cf509b
4
+ data.tar.gz: b7c3fb55244a74192bea9c32ff5a984a6d1952d850c99816db268bbdd3e0a5c8
5
5
  SHA512:
6
- metadata.gz: 4658b96bc5da62317f70bd22f06e12c8cc8ff7c3bc2ae69b6f29854b77d3139874c606919d38cf122a2f58f6017d5618787c8d763bc08297cb41cbf972da05ea
7
- data.tar.gz: 4ca0853aa3c5af8b22a78166203dfe9f767cf2c972f9a402f382470e6fe3484f199277632a336991e8f55fdd584f02983823eab6bf489320d786dead06353059
6
+ metadata.gz: 175a5a434c88bfb3df0e6b2711d1b5afc24e480dbc4699fa35d91b21183937b9eddb347da96d5f52efbd8a96cdc24d6b0605d1ef722aae53331a5321b8231710
7
+ data.tar.gz: 4b3692c9b7afb27a6a5f5c41bdcabadf460a3deb5d1a7fe53a7f6f21fb73a22c84e592ca230db031c36acca0c5d6c036a06f1d394af7c51a1df0b2fd555ad5a3
data/Gemfile CHANGED
@@ -7,33 +7,28 @@ gemspec
7
7
  group :development do
8
8
  # bootstrapping
9
9
  gem "bundler", "~> 2.3"
10
- gem "rake", "= 13.0.6"
10
+ gem "rake", "13.2.1"
11
11
 
12
12
  # building extensions
13
- gem "rake-compiler", "= 1.2.1"
14
- gem "rake-compiler-dock", "= 1.3.0"
15
-
16
- # documentation
17
- gem "hoe-markdown", "= 1.4.0"
13
+ gem "rake-compiler", "1.2.8"
14
+ gem "rake-compiler-dock", "1.7.0"
18
15
 
19
16
  # parser generator
20
- gem "rexical", "= 1.0.7"
17
+ gem "rexical", "1.0.8"
21
18
 
22
19
  # tests
23
- gem "minitest", "5.18.0"
24
- gem "minitest-reporters", "1.6.0"
25
- gem "ruby_memcheck", "1.3.2"
20
+ gem "minitest", "5.25.4"
21
+ gem "minitest-parallel_fork", "2.0.0"
22
+ gem "ruby_memcheck", "3.0.0"
26
23
  gem "rubyzip", "~> 2.3.2"
27
24
  gem "simplecov", "= 0.21.2"
28
25
 
29
26
  # rubocop
30
- if Gem::Requirement.new("~> 3.0").satisfied_by?(Gem::Version.new(RUBY_VERSION))
31
- gem "rubocop", "1.51.0"
32
- gem "rubocop-minitest", "0.31.0"
27
+ unless RUBY_PLATFORM == "java"
28
+ gem "standard", "1.43.0"
29
+ gem "rubocop-minitest", "0.36.0"
33
30
  gem "rubocop-packaging", "0.5.2"
34
- gem "rubocop-performance", "1.18.0"
35
- gem "rubocop-rake", "= 0.6.0"
36
- gem "rubocop-shopify", "2.13.0"
31
+ gem "rubocop-rake", "0.6.0"
37
32
  end
38
33
  end
39
34
 
@@ -41,5 +36,5 @@ end
41
36
  # `bundle config set --local without rdoc`
42
37
  # Then re-run `bundle install`.
43
38
  group :rdoc do
44
- gem "rdoc", "6.5.0"
39
+ gem "rdoc", "6.10.0" unless RUBY_PLATFORM == "java" || ENV["CI"]
45
40
  end
@@ -10,9 +10,9 @@ Note that this document is broken into multiple sections, each of which describe
10
10
 
11
11
  - [Platform Releases](#platform-releases)
12
12
  * [Default platform release ("ruby")](#default-platform-release-ruby)
13
- * [Native LinuxⓇ platform releases ("x86_64-linux", "arm64-linux", "aarch64-linux", and "arm-linux")](#native-linux%E2%93%A1-platform-releases-x86_64-linux-arm64-linux-aarch64-linux-and-arm-linux)
13
+ * [Native LinuxⓇ platform releases ("x86_64-linux", "aarch64-linux", and "arm-linux")](#native-linux%E2%93%A1-platform-releases-x86_64-linux-aarch64-linux-and-arm-linux)
14
14
  * [Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin")](#native-darwin-macos%E2%93%A1-platform-releases-x86_64-darwin-and-arm64-darwin)
15
- * [Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32")](#native-windows%E2%93%A1-platform-releases-x86-mingw32-and-x64-mingw32)
15
+ * [Native WindowsⓇ platform releases ("x64-mingw-ucrt")](#native-windows%E2%93%A1-platform-releases-x64-mingw-ucrt)
16
16
  * [JavaⓇ (JRuby) platform release ("java")](#java%E2%93%A1-jruby-platform-release-java)
17
17
  - [Appendix: Dependencies' License Texts](#appendix-dependencies-license-texts)
18
18
  * [libgumbo](#libgumbo)
@@ -51,7 +51,7 @@ The default platform release distributes the following dependencies in source fo
51
51
  This distribution can be identified by inspecting the included Gem::Specification, which will have the value "ruby" for its "platform" attribute.
52
52
 
53
53
 
54
- ### Native LinuxⓇ platform releases ("x86_64-linux", "arm64-linux", "aarch64-linux", and "arm-linux")
54
+ ### Native LinuxⓇ platform releases ("x86_64-linux", "aarch64-linux", and "arm-linux")
55
55
 
56
56
  The native LinuxⓇ platform release distributes the following dependencies in source form:
57
57
 
@@ -60,7 +60,7 @@ The native LinuxⓇ platform release distributes the following dependencies in s
60
60
  * [libgumbo](#libgumbo)
61
61
  * [zlib](#zlib)
62
62
 
63
- This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-linux" or "arm64-linux" for its "platform.cpu" attribute.
63
+ This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-linux" or "aarch64-linux" for its "platform.cpu" attribute.
64
64
 
65
65
 
66
66
  ### Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin")
@@ -76,7 +76,7 @@ The native Darwin platform release distributes the following dependencies in sou
76
76
  This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-darwin" or "arm64-darwin" for its "platform.cpu" attribute. Darwin is also known more familiarly as "OSX" or "macOSⓇ" and is the operating system for many AppleⓇ computers.
77
77
 
78
78
 
79
- ### Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32")
79
+ ### Native WindowsⓇ platform releases ("x64-mingw-ucrt")
80
80
 
81
81
  The native WindowsⓇ platform release distributes the following dependencies in source form:
82
82
 
@@ -86,7 +86,7 @@ The native WindowsⓇ platform release distributes the following dependencies in
86
86
  * [zlib](#zlib)
87
87
  * [libiconv](#libiconv)
88
88
 
89
- This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x64-mingw32" or "x86-mingw32" for its "platform.cpu" attribute.
89
+ This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x64-mingw-ucrt" for its "platform.cpu" attribute.
90
90
 
91
91
 
92
92
  ### JavaⓇ (JRuby) platform release ("java")
data/README.md CHANGED
@@ -55,6 +55,7 @@ There are a few ways to ask exploratory questions:
55
55
 
56
56
  - The Nokogiri mailing list is active at https://groups.google.com/group/nokogiri-talk
57
57
  - Open an issue using the "Help Request" template at https://github.com/sparklemotion/nokogiri/issues
58
+ - Open a discussion at https://github.com/sparklemotion/nokogiri/discussions
58
59
 
59
60
  Please do not mail the maintainers at their personal addresses.
60
61
 
@@ -90,6 +91,8 @@ We bump `Major.Minor.Patch` versions following this guidance:
90
91
  - Updating packaged libraries for non-security-related reasons.
91
92
  - Dropping support for EOLed Ruby versions. [Some folks find this objectionable](https://github.com/sparklemotion/nokogiri/issues/1568), but [SemVer says this is OK if the public API hasn't changed](https://semver.org/#what-should-i-do-if-i-update-my-own-dependencies-without-changing-the-public-api).
92
93
  - Backwards-incompatible changes to internal or private methods and constants. These are detailed in the "Changes" section of each changelog entry.
94
+ - Removal of deprecated methods or parameters, after a generous transition period; usually when those methods or parameters are rarely-used or dangerous to the user. Essentially, removals that do not justify a major version bump.
95
+
93
96
 
94
97
  `Patch`:
95
98
 
@@ -111,9 +114,13 @@ You can help sponsor the maintainers of this software through one of these organ
111
114
 
112
115
  Requirements:
113
116
 
114
- - Ruby >= 2.7
117
+ - Ruby >= 3.1
115
118
  - JRuby >= 9.4.0.0
116
119
 
120
+ If you are compiling the native extension against a system version of libxml2:
121
+
122
+ - libxml2 >= 2.9.2 (recommended >= 2.12.0)
123
+
117
124
 
118
125
  ### Native Gems: Faster, more reliable installation
119
126
 
@@ -124,11 +131,10 @@ Requirements:
124
131
  Nokogiri ships pre-compiled, "native" gems for the following platforms:
125
132
 
126
133
  - Linux:
127
- - `x86-linux` and `x86_64-linux` (req: `glibc >= 2.17`)
128
- - `aarch64-linux` and `arm-linux` (req: `glibc >= 2.29`)
129
- - Note that musl platforms like Alpine **are** supported
134
+ - `x86_64-linux-gnu`, `aarch64-linux-gnu`, and `arm-linux-gnu` (req: `glibc >= 2.29`)
135
+ - `x86_64-linux-musl`, `aarch64-linux-musl`, and `arm-linux-musl`
130
136
  - Darwin/MacOS: `x86_64-darwin` and `arm64-darwin`
131
- - Windows: `x86-mingw32`, `x64-mingw32`, and `x64-mingw-ucrt`
137
+ - Windows: `x64-mingw-ucrt`
132
138
  - Java: any platform running JRuby 9.4 or higher
133
139
 
134
140
  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'`.
data/dependencies.yml CHANGED
@@ -1,16 +1,17 @@
1
+ ---
1
2
  libxml2:
2
- version: "2.11.4"
3
- sha256: "737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7"
4
- # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.4.sha256sum
3
+ version: "2.13.7"
4
+ sha256: "14796d24402108e99d8de4e974d539bed62e23af8c4233317274ce073ceff93b"
5
+ # sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.7.sha256sum
5
6
 
6
7
  libxslt:
7
- version: "1.1.38"
8
- sha256: "1f32450425819a09acaff2ab7a5a7f8a2ec7956e505d7beeb45e843d0e1ecab1"
9
- # sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.38.sha256sum
8
+ version: "1.1.43"
9
+ sha256: "5a3d6b383ca5afc235b171118e90f5ff6aa27e9fea3303065231a6d403f0183a"
10
+ # sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.43.sha256sum
10
11
 
11
12
  zlib:
12
- version: "1.2.13"
13
- sha256: "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30"
13
+ version: "1.3.1"
14
+ sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23"
14
15
  # SHA-256 hash provided on http://zlib.net/
15
16
 
16
17
  libiconv: