nokogiri 1.13.10 → 1.14.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +33 -0
  3. data/LICENSE-DEPENDENCIES.md +830 -509
  4. data/README.md +18 -11
  5. data/dependencies.yml +25 -7
  6. data/ext/nokogiri/extconf.rb +79 -20
  7. data/ext/nokogiri/gumbo.c +19 -9
  8. data/ext/nokogiri/html4_document.c +1 -1
  9. data/ext/nokogiri/html4_entity_lookup.c +1 -1
  10. data/ext/nokogiri/html4_sax_parser_context.c +0 -5
  11. data/ext/nokogiri/nokogiri.c +32 -51
  12. data/ext/nokogiri/nokogiri.h +17 -14
  13. data/ext/nokogiri/xml_attribute_decl.c +1 -1
  14. data/ext/nokogiri/xml_cdata.c +1 -1
  15. data/ext/nokogiri/xml_document.c +16 -11
  16. data/ext/nokogiri/xml_element_content.c +2 -2
  17. data/ext/nokogiri/xml_element_decl.c +1 -1
  18. data/ext/nokogiri/xml_encoding_handler.c +2 -2
  19. data/ext/nokogiri/xml_namespace.c +38 -8
  20. data/ext/nokogiri/xml_node.c +286 -26
  21. data/ext/nokogiri/xml_node_set.c +0 -2
  22. data/ext/nokogiri/xml_reader.c +40 -20
  23. data/ext/nokogiri/xml_relax_ng.c +0 -2
  24. data/ext/nokogiri/xml_sax_parser.c +22 -16
  25. data/ext/nokogiri/xml_sax_parser_context.c +0 -5
  26. data/ext/nokogiri/xml_sax_push_parser.c +0 -2
  27. data/ext/nokogiri/xml_schema.c +0 -2
  28. data/ext/nokogiri/xml_xpath_context.c +87 -83
  29. data/ext/nokogiri/xslt_stylesheet.c +14 -13
  30. data/gumbo-parser/Makefile +10 -0
  31. data/gumbo-parser/src/attribute.h +1 -1
  32. data/gumbo-parser/src/error.c +1 -1
  33. data/gumbo-parser/src/error.h +1 -1
  34. data/gumbo-parser/src/foreign_attrs.c +2 -2
  35. data/gumbo-parser/src/{gumbo.h → nokogiri_gumbo.h} +1 -0
  36. data/gumbo-parser/src/parser.c +7 -4
  37. data/gumbo-parser/src/replacement.h +1 -1
  38. data/gumbo-parser/src/string_buffer.h +1 -1
  39. data/gumbo-parser/src/string_piece.c +1 -1
  40. data/gumbo-parser/src/svg_attrs.c +2 -2
  41. data/gumbo-parser/src/svg_tags.c +2 -2
  42. data/gumbo-parser/src/tag.c +2 -1
  43. data/gumbo-parser/src/tag_lookup.c +7 -7
  44. data/gumbo-parser/src/tag_lookup.gperf +1 -0
  45. data/gumbo-parser/src/tag_lookup.h +1 -1
  46. data/gumbo-parser/src/token_buffer.h +1 -1
  47. data/gumbo-parser/src/tokenizer.c +1 -1
  48. data/gumbo-parser/src/tokenizer.h +1 -1
  49. data/gumbo-parser/src/utf8.c +1 -1
  50. data/gumbo-parser/src/utf8.h +1 -1
  51. data/gumbo-parser/src/util.c +1 -3
  52. data/gumbo-parser/src/util.h +4 -0
  53. data/gumbo-parser/src/vector.h +1 -1
  54. data/lib/nokogiri/css/node.rb +2 -2
  55. data/lib/nokogiri/css/xpath_visitor.rb +3 -1
  56. data/lib/nokogiri/css.rb +6 -0
  57. data/lib/nokogiri/encoding_handler.rb +57 -0
  58. data/lib/nokogiri/extension.rb +3 -2
  59. data/lib/nokogiri/html4/document.rb +2 -121
  60. data/lib/nokogiri/html4/element_description_defaults.rb +6 -12
  61. data/lib/nokogiri/html4/encoding_reader.rb +121 -0
  62. data/lib/nokogiri/html4.rb +1 -0
  63. data/lib/nokogiri/html5/document.rb +113 -36
  64. data/lib/nokogiri/html5/document_fragment.rb +9 -2
  65. data/lib/nokogiri/html5/node.rb +3 -5
  66. data/lib/nokogiri/html5.rb +127 -216
  67. data/lib/nokogiri/jruby/dependencies.rb +1 -19
  68. data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
  69. data/lib/nokogiri/version/constant.rb +1 -1
  70. data/lib/nokogiri/version/info.rb +11 -10
  71. data/lib/nokogiri/xml/attr.rb +49 -0
  72. data/lib/nokogiri/xml/builder.rb +1 -1
  73. data/lib/nokogiri/xml/document.rb +102 -54
  74. data/lib/nokogiri/xml/document_fragment.rb +49 -6
  75. data/lib/nokogiri/xml/namespace.rb +42 -0
  76. data/lib/nokogiri/xml/node/save_options.rb +4 -2
  77. data/lib/nokogiri/xml/node.rb +190 -35
  78. data/lib/nokogiri/xml/node_set.rb +87 -9
  79. data/lib/nokogiri/xml/parse_options.rb +127 -48
  80. data/lib/nokogiri/xml/pp/node.rb +6 -4
  81. data/lib/nokogiri/xml/processing_instruction.rb +2 -1
  82. data/lib/nokogiri/xml/sax/parser.rb +2 -3
  83. data/lib/nokogiri/xslt.rb +1 -1
  84. data/lib/nokogiri.rb +3 -11
  85. metadata +11 -247
  86. data/patches/libxml2/0005-avoid-isnan-isinf.patch +0 -81
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.10
4
+ version: 1.14.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2022-12-07 00:00:00.000000000 Z
23
+ date: 2022-12-28 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mini_portile2
@@ -50,248 +50,10 @@ dependencies:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '1.4'
53
- - !ruby/object:Gem::Dependency
54
- name: bundler
55
- requirement: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '2.2'
60
- type: :development
61
- prerelease: false
62
- version_requirements: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '2.2'
67
- - !ruby/object:Gem::Dependency
68
- name: hoe-markdown
69
- requirement: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '1.4'
74
- type: :development
75
- prerelease: false
76
- version_requirements: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '1.4'
81
- - !ruby/object:Gem::Dependency
82
- name: minitest
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '5.15'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '5.15'
95
- - !ruby/object:Gem::Dependency
96
- name: minitest-reporters
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '1.4'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '1.4'
109
- - !ruby/object:Gem::Dependency
110
- name: psych
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '4.0'
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: '4.0'
123
- - !ruby/object:Gem::Dependency
124
- name: rake
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '13.0'
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - "~>"
135
- - !ruby/object:Gem::Version
136
- version: '13.0'
137
- - !ruby/object:Gem::Dependency
138
- name: rake-compiler
139
- requirement: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - '='
142
- - !ruby/object:Gem::Version
143
- version: 1.1.7
144
- type: :development
145
- prerelease: false
146
- version_requirements: !ruby/object:Gem::Requirement
147
- requirements:
148
- - - '='
149
- - !ruby/object:Gem::Version
150
- version: 1.1.7
151
- - !ruby/object:Gem::Dependency
152
- name: rake-compiler-dock
153
- requirement: !ruby/object:Gem::Requirement
154
- requirements:
155
- - - '='
156
- - !ruby/object:Gem::Version
157
- version: 1.2.2
158
- type: :development
159
- prerelease: false
160
- version_requirements: !ruby/object:Gem::Requirement
161
- requirements:
162
- - - '='
163
- - !ruby/object:Gem::Version
164
- version: 1.2.2
165
- - !ruby/object:Gem::Dependency
166
- name: rdoc
167
- requirement: !ruby/object:Gem::Requirement
168
- requirements:
169
- - - "~>"
170
- - !ruby/object:Gem::Version
171
- version: '6.3'
172
- type: :development
173
- prerelease: false
174
- version_requirements: !ruby/object:Gem::Requirement
175
- requirements:
176
- - - "~>"
177
- - !ruby/object:Gem::Version
178
- version: '6.3'
179
- - !ruby/object:Gem::Dependency
180
- name: rexical
181
- requirement: !ruby/object:Gem::Requirement
182
- requirements:
183
- - - "~>"
184
- - !ruby/object:Gem::Version
185
- version: 1.0.7
186
- type: :development
187
- prerelease: false
188
- version_requirements: !ruby/object:Gem::Requirement
189
- requirements:
190
- - - "~>"
191
- - !ruby/object:Gem::Version
192
- version: 1.0.7
193
- - !ruby/object:Gem::Dependency
194
- name: rubocop
195
- requirement: !ruby/object:Gem::Requirement
196
- requirements:
197
- - - "~>"
198
- - !ruby/object:Gem::Version
199
- version: 1.30.1
200
- type: :development
201
- prerelease: false
202
- version_requirements: !ruby/object:Gem::Requirement
203
- requirements:
204
- - - "~>"
205
- - !ruby/object:Gem::Version
206
- version: 1.30.1
207
- - !ruby/object:Gem::Dependency
208
- name: rubocop-minitest
209
- requirement: !ruby/object:Gem::Requirement
210
- requirements:
211
- - - "~>"
212
- - !ruby/object:Gem::Version
213
- version: '0.17'
214
- type: :development
215
- prerelease: false
216
- version_requirements: !ruby/object:Gem::Requirement
217
- requirements:
218
- - - "~>"
219
- - !ruby/object:Gem::Version
220
- version: '0.17'
221
- - !ruby/object:Gem::Dependency
222
- name: rubocop-performance
223
- requirement: !ruby/object:Gem::Requirement
224
- requirements:
225
- - - "~>"
226
- - !ruby/object:Gem::Version
227
- version: '1.12'
228
- type: :development
229
- prerelease: false
230
- version_requirements: !ruby/object:Gem::Requirement
231
- requirements:
232
- - - "~>"
233
- - !ruby/object:Gem::Version
234
- version: '1.12'
235
- - !ruby/object:Gem::Dependency
236
- name: rubocop-rake
237
- requirement: !ruby/object:Gem::Requirement
238
- requirements:
239
- - - "~>"
240
- - !ruby/object:Gem::Version
241
- version: '0.6'
242
- type: :development
243
- prerelease: false
244
- version_requirements: !ruby/object:Gem::Requirement
245
- requirements:
246
- - - "~>"
247
- - !ruby/object:Gem::Version
248
- version: '0.6'
249
- - !ruby/object:Gem::Dependency
250
- name: rubocop-shopify
251
- requirement: !ruby/object:Gem::Requirement
252
- requirements:
253
- - - '='
254
- - !ruby/object:Gem::Version
255
- version: 2.5.0
256
- type: :development
257
- prerelease: false
258
- version_requirements: !ruby/object:Gem::Requirement
259
- requirements:
260
- - - '='
261
- - !ruby/object:Gem::Version
262
- version: 2.5.0
263
- - !ruby/object:Gem::Dependency
264
- name: ruby_memcheck
265
- requirement: !ruby/object:Gem::Requirement
266
- requirements:
267
- - - "~>"
268
- - !ruby/object:Gem::Version
269
- version: '1.0'
270
- type: :development
271
- prerelease: false
272
- version_requirements: !ruby/object:Gem::Requirement
273
- requirements:
274
- - - "~>"
275
- - !ruby/object:Gem::Version
276
- version: '1.0'
277
- - !ruby/object:Gem::Dependency
278
- name: simplecov
279
- requirement: !ruby/object:Gem::Requirement
280
- requirements:
281
- - - "~>"
282
- - !ruby/object:Gem::Version
283
- version: '0.21'
284
- type: :development
285
- prerelease: false
286
- version_requirements: !ruby/object:Gem::Requirement
287
- requirements:
288
- - - "~>"
289
- - !ruby/object:Gem::Version
290
- version: '0.21'
291
53
  description: |
292
54
  Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a
293
55
  sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is
294
- fast and standards-compliant by relying on native parsers like libxml2 (C) and xerces (Java).
56
+ fast and standards-compliant by relying on native parsers like libxml2, libgumbo, or xerces.
295
57
  email: nokogiri-talk@googlegroups.com
296
58
  executables:
297
59
  - nokogiri
@@ -395,9 +157,9 @@ files:
395
157
  - gumbo-parser/src/error.h
396
158
  - gumbo-parser/src/foreign_attrs.c
397
159
  - gumbo-parser/src/foreign_attrs.gperf
398
- - gumbo-parser/src/gumbo.h
399
160
  - gumbo-parser/src/insertion_mode.h
400
161
  - gumbo-parser/src/macros.h
162
+ - gumbo-parser/src/nokogiri_gumbo.h
401
163
  - gumbo-parser/src/parser.c
402
164
  - gumbo-parser/src/parser.h
403
165
  - gumbo-parser/src/replacement.h
@@ -436,6 +198,7 @@ files:
436
198
  - lib/nokogiri/css/tokenizer.rex
437
199
  - lib/nokogiri/css/xpath_visitor.rb
438
200
  - lib/nokogiri/decorators/slop.rb
201
+ - lib/nokogiri/encoding_handler.rb
439
202
  - lib/nokogiri/extension.rb
440
203
  - lib/nokogiri/gumbo.rb
441
204
  - lib/nokogiri/html.rb
@@ -445,6 +208,7 @@ files:
445
208
  - lib/nokogiri/html4/document_fragment.rb
446
209
  - lib/nokogiri/html4/element_description.rb
447
210
  - lib/nokogiri/html4/element_description_defaults.rb
211
+ - lib/nokogiri/html4/encoding_reader.rb
448
212
  - lib/nokogiri/html4/entity_lookup.rb
449
213
  - lib/nokogiri/html4/sax/parser.rb
450
214
  - lib/nokogiri/html4/sax/parser_context.rb
@@ -454,6 +218,7 @@ files:
454
218
  - lib/nokogiri/html5/document_fragment.rb
455
219
  - lib/nokogiri/html5/node.rb
456
220
  - lib/nokogiri/jruby/dependencies.rb
221
+ - lib/nokogiri/jruby/nokogiri_jars.rb
457
222
  - lib/nokogiri/syntax_error.rb
458
223
  - lib/nokogiri/version.rb
459
224
  - lib/nokogiri/version/constant.rb
@@ -501,7 +266,6 @@ files:
501
266
  - patches/libxml2/0001-Remove-script-macro-support.patch
502
267
  - patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
503
268
  - patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
504
- - patches/libxml2/0005-avoid-isnan-isinf.patch
505
269
  - patches/libxml2/0009-allow-wildcard-namespaces.patch
506
270
  - patches/libxslt/0001-update-automake-files-for-arm64.patch
507
271
  - ports/archives/libxml2-2.10.3.tar.xz
@@ -526,14 +290,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
526
290
  requirements:
527
291
  - - ">="
528
292
  - !ruby/object:Gem::Version
529
- version: 2.6.0
293
+ version: 2.7.0
530
294
  required_rubygems_version: !ruby/object:Gem::Requirement
531
295
  requirements:
532
- - - ">="
296
+ - - ">"
533
297
  - !ruby/object:Gem::Version
534
- version: '0'
298
+ version: 1.3.1
535
299
  requirements: []
536
- rubygems_version: 3.3.7
300
+ rubygems_version: 3.3.26
537
301
  signing_key:
538
302
  specification_version: 4
539
303
  summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
@@ -1,81 +0,0 @@
1
- This patch is a result of rake-compiler-dock using centos 7 (manylinux2014) to cross-compile.
2
-
3
- Centos, for reasons I have not been able to discern, implements `isnan` and `isinf` as a function
4
- and not as a macro. Debian knows how to resolve that function at dynamic-link time (despite using a
5
- macro at compile time), but musl-based systems (like alpine) do not. Running `nm` on nokogiri.so
6
- created on such a centos system shows:
7
-
8
- ```
9
- U __isinf@@GLIBC_2.2.5
10
- U __isnan@@GLIBC_2.2.5
11
- ```
12
-
13
- (see https://github.com/sparklemotion/nokogiri/pull/2142 for more info)
14
-
15
- This patch avoids using glibc's `isnan` and `isinf` calls, instead using libxml2's fallback
16
- implementation. There's history here, see libxml2 commit 8813f39:
17
-
18
- commit 8813f39
19
- Author: Nick Wellnhofer <wellnhofer@aevum.de>
20
- Date: 2017-09-21 00:11:26 +0200
21
-
22
- Simplify XPath NaN, inf and -0 handling
23
-
24
- Use C99 macros NAN, INFINITY, isnan, isinf. If they're not available:
25
-
26
- - Assume that (0.0 / 0.0) generates a NaN and !(x == x) tests for NaN.
27
- - Use C89's HUGE_VAL for INFINITY.
28
-
29
- Remove manual handling of NaN, infinity and negative zero in functions
30
- xmlXPathValueFlipSign and xmlXPathDivValues.
31
-
32
- Remove xmlXPathGetSign. All the tests for negative zero can be replaced
33
- with a test for negative or positive zero.
34
-
35
- Simplify xmlXPathRoundFunction.
36
-
37
- Remove Trio dependency.
38
-
39
- This should work on IEEE 754 compliant implementations even if the C99
40
- macros aren't available, but will likely break some ancient platforms.
41
- If problems arise, my plan is to port the relevant trionan.c solution
42
- to xpath.c. Note that non-compliant implementations are impossible
43
- to fully support, anyway, since XPath requires IEEE 754.
44
-
45
- This patch would be unnecessary if any of the following was true:
46
-
47
- * centos implements these as macros, and doesn't generate an unresolved symbol for either in the shared library
48
- * we had a way to ensure `__isinf` and `__isnan` resolve on musl (e.g., we implement them locally)
49
-
50
- diff --git a/xpath.c b/xpath.c
51
- index 9f64ab9..5b6d999 100644
52
- --- a/xpath.c
53
- +++ b/xpath.c
54
- @@ -515,11 +515,7 @@ xmlXPathInit(void) {
55
- */
56
- int
57
- xmlXPathIsNaN(double val) {
58
- -#ifdef isnan
59
- - return isnan(val);
60
- -#else
61
- return !(val == val);
62
- -#endif
63
- }
64
-
65
- /**
66
- @@ -530,15 +530,11 @@ xmlXPathIsNaN(double val) {
67
- */
68
- int
69
- xmlXPathIsInf(double val) {
70
- -#ifdef isinf
71
- - return isinf(val) ? (val > 0 ? 1 : -1) : 0;
72
- -#else
73
- if (val >= xmlXPathPINF)
74
- return 1;
75
- if (val <= -xmlXPathPINF)
76
- return -1;
77
- return 0;
78
- -#endif
79
- }
80
-
81
- #endif /* SCHEMAS or XPATH */