nokogiri 1.12.5 → 1.13.10

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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/README.md +9 -7
  4. data/bin/nokogiri +63 -50
  5. data/dependencies.yml +13 -64
  6. data/ext/nokogiri/extconf.rb +81 -46
  7. data/ext/nokogiri/gumbo.c +1 -1
  8. data/ext/nokogiri/html4_sax_parser_context.c +2 -3
  9. data/ext/nokogiri/nokogiri.h +9 -0
  10. data/ext/nokogiri/xml_attr.c +2 -2
  11. data/ext/nokogiri/xml_attribute_decl.c +3 -3
  12. data/ext/nokogiri/xml_cdata.c +1 -1
  13. data/ext/nokogiri/xml_document.c +41 -37
  14. data/ext/nokogiri/xml_document_fragment.c +0 -2
  15. data/ext/nokogiri/xml_dtd.c +10 -10
  16. data/ext/nokogiri/xml_element_decl.c +3 -3
  17. data/ext/nokogiri/xml_encoding_handler.c +25 -11
  18. data/ext/nokogiri/xml_entity_decl.c +5 -5
  19. data/ext/nokogiri/xml_namespace.c +41 -5
  20. data/ext/nokogiri/xml_node.c +708 -382
  21. data/ext/nokogiri/xml_node_set.c +4 -4
  22. data/ext/nokogiri/xml_reader.c +92 -11
  23. data/ext/nokogiri/xml_sax_parser_context.c +10 -3
  24. data/ext/nokogiri/xml_schema.c +3 -3
  25. data/ext/nokogiri/xml_text.c +1 -1
  26. data/ext/nokogiri/xml_xpath_context.c +76 -50
  27. data/ext/nokogiri/xslt_stylesheet.c +107 -9
  28. data/gumbo-parser/src/parser.c +0 -11
  29. data/lib/nokogiri/class_resolver.rb +67 -0
  30. data/lib/nokogiri/css/node.rb +9 -8
  31. data/lib/nokogiri/css/parser.rb +360 -341
  32. data/lib/nokogiri/css/parser.y +249 -244
  33. data/lib/nokogiri/css/parser_extras.rb +22 -20
  34. data/lib/nokogiri/css/syntax_error.rb +1 -0
  35. data/lib/nokogiri/css/tokenizer.rb +4 -3
  36. data/lib/nokogiri/css/tokenizer.rex +3 -2
  37. data/lib/nokogiri/css/xpath_visitor.rb +179 -82
  38. data/lib/nokogiri/css.rb +38 -6
  39. data/lib/nokogiri/decorators/slop.rb +8 -7
  40. data/lib/nokogiri/extension.rb +1 -1
  41. data/lib/nokogiri/gumbo.rb +1 -0
  42. data/lib/nokogiri/html.rb +16 -10
  43. data/lib/nokogiri/html4/builder.rb +1 -0
  44. data/lib/nokogiri/html4/document.rb +88 -77
  45. data/lib/nokogiri/html4/document_fragment.rb +11 -7
  46. data/lib/nokogiri/html4/element_description.rb +1 -0
  47. data/lib/nokogiri/html4/element_description_defaults.rb +426 -520
  48. data/lib/nokogiri/html4/entity_lookup.rb +2 -1
  49. data/lib/nokogiri/html4/sax/parser.rb +5 -2
  50. data/lib/nokogiri/html4/sax/parser_context.rb +1 -0
  51. data/lib/nokogiri/html4/sax/push_parser.rb +7 -7
  52. data/lib/nokogiri/html4.rb +11 -5
  53. data/lib/nokogiri/html5/document.rb +27 -10
  54. data/lib/nokogiri/html5/document_fragment.rb +5 -2
  55. data/lib/nokogiri/html5/node.rb +10 -3
  56. data/lib/nokogiri/html5.rb +69 -64
  57. data/lib/nokogiri/jruby/dependencies.rb +10 -9
  58. data/lib/nokogiri/syntax_error.rb +1 -0
  59. data/lib/nokogiri/version/constant.rb +2 -1
  60. data/lib/nokogiri/version/info.rb +20 -13
  61. data/lib/nokogiri/version.rb +1 -0
  62. data/lib/nokogiri/xml/attr.rb +5 -3
  63. data/lib/nokogiri/xml/attribute_decl.rb +2 -1
  64. data/lib/nokogiri/xml/builder.rb +34 -32
  65. data/lib/nokogiri/xml/cdata.rb +2 -1
  66. data/lib/nokogiri/xml/character_data.rb +1 -0
  67. data/lib/nokogiri/xml/document.rb +144 -103
  68. data/lib/nokogiri/xml/document_fragment.rb +41 -38
  69. data/lib/nokogiri/xml/dtd.rb +3 -2
  70. data/lib/nokogiri/xml/element_content.rb +1 -0
  71. data/lib/nokogiri/xml/element_decl.rb +2 -1
  72. data/lib/nokogiri/xml/entity_decl.rb +3 -2
  73. data/lib/nokogiri/xml/entity_reference.rb +1 -0
  74. data/lib/nokogiri/xml/namespace.rb +2 -0
  75. data/lib/nokogiri/xml/node/save_options.rb +8 -4
  76. data/lib/nokogiri/xml/node.rb +521 -351
  77. data/lib/nokogiri/xml/node_set.rb +50 -54
  78. data/lib/nokogiri/xml/notation.rb +12 -0
  79. data/lib/nokogiri/xml/parse_options.rb +12 -7
  80. data/lib/nokogiri/xml/pp/character_data.rb +8 -6
  81. data/lib/nokogiri/xml/pp/node.rb +24 -26
  82. data/lib/nokogiri/xml/pp.rb +1 -0
  83. data/lib/nokogiri/xml/processing_instruction.rb +2 -1
  84. data/lib/nokogiri/xml/reader.rb +20 -24
  85. data/lib/nokogiri/xml/relax_ng.rb +1 -0
  86. data/lib/nokogiri/xml/sax/document.rb +20 -19
  87. data/lib/nokogiri/xml/sax/parser.rb +37 -34
  88. data/lib/nokogiri/xml/sax/parser_context.rb +7 -3
  89. data/lib/nokogiri/xml/sax/push_parser.rb +5 -5
  90. data/lib/nokogiri/xml/sax.rb +1 -0
  91. data/lib/nokogiri/xml/schema.rb +7 -6
  92. data/lib/nokogiri/xml/searchable.rb +93 -62
  93. data/lib/nokogiri/xml/syntax_error.rb +5 -4
  94. data/lib/nokogiri/xml/text.rb +1 -0
  95. data/lib/nokogiri/xml/xpath/syntax_error.rb +2 -1
  96. data/lib/nokogiri/xml/xpath.rb +12 -0
  97. data/lib/nokogiri/xml/xpath_context.rb +2 -3
  98. data/lib/nokogiri/xml.rb +4 -3
  99. data/lib/nokogiri/xslt/stylesheet.rb +1 -0
  100. data/lib/nokogiri/xslt.rb +21 -13
  101. data/lib/nokogiri.rb +19 -16
  102. data/lib/xsd/xmlparser/nokogiri.rb +25 -24
  103. data/patches/libxml2/0009-allow-wildcard-namespaces.patch +77 -0
  104. data/patches/libxslt/0001-update-automake-files-for-arm64.patch +2445 -1919
  105. data/ports/archives/libxml2-2.10.3.tar.xz +0 -0
  106. data/ports/archives/libxslt-1.1.37.tar.xz +0 -0
  107. metadata +117 -34
  108. data/patches/libxml2/0004-use-glibc-strlen.patch +0 -53
  109. data/patches/libxml2/0006-update-automake-files-for-arm64.patch +0 -2511
  110. data/patches/libxml2/0007-Fix-XPath-recursion-limit.patch +0 -31
  111. data/patches/libxslt/0002-Fix-xml2-config-check-in-configure-script.patch +0 -19
  112. data/ports/archives/libxml2-2.9.12.tar.gz +0 -0
  113. data/ports/archives/libxslt-1.1.34.tar.gz +0 -0
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.12.5
4
+ version: 1.13.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -20,36 +20,36 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2021-09-27 00:00:00.000000000 Z
23
+ date: 2022-12-07 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
- name: racc
26
+ name: mini_portile2
27
27
  requirement: !ruby/object:Gem::Requirement
28
28
  requirements:
29
29
  - - "~>"
30
30
  - !ruby/object:Gem::Version
31
- version: '1.4'
31
+ version: 2.8.0
32
32
  type: :runtime
33
33
  prerelease: false
34
34
  version_requirements: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - "~>"
37
37
  - !ruby/object:Gem::Version
38
- version: '1.4'
38
+ version: 2.8.0
39
39
  - !ruby/object:Gem::Dependency
40
- name: mini_portile2
40
+ name: racc
41
41
  requirement: !ruby/object:Gem::Requirement
42
42
  requirements:
43
43
  - - "~>"
44
44
  - !ruby/object:Gem::Version
45
- version: 2.6.1
45
+ version: '1.4'
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: 2.6.1
52
+ version: '1.4'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: bundler
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -84,14 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '5.8'
87
+ version: '5.15'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '5.8'
94
+ version: '5.15'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: minitest-reporters
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -106,6 +106,20 @@ dependencies:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
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'
109
123
  - !ruby/object:Gem::Dependency
110
124
  name: rake
111
125
  requirement: !ruby/object:Gem::Requirement
@@ -124,86 +138,156 @@ dependencies:
124
138
  name: rake-compiler
125
139
  requirement: !ruby/object:Gem::Requirement
126
140
  requirements:
127
- - - "~>"
141
+ - - '='
128
142
  - !ruby/object:Gem::Version
129
- version: '1.1'
143
+ version: 1.1.7
130
144
  type: :development
131
145
  prerelease: false
132
146
  version_requirements: !ruby/object:Gem::Requirement
133
147
  requirements:
134
- - - "~>"
148
+ - - '='
135
149
  - !ruby/object:Gem::Version
136
- version: '1.1'
150
+ version: 1.1.7
137
151
  - !ruby/object:Gem::Dependency
138
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
139
167
  requirement: !ruby/object:Gem::Requirement
140
168
  requirements:
141
169
  - - "~>"
142
170
  - !ruby/object:Gem::Version
143
- version: '1.1'
171
+ version: '6.3'
144
172
  type: :development
145
173
  prerelease: false
146
174
  version_requirements: !ruby/object:Gem::Requirement
147
175
  requirements:
148
176
  - - "~>"
149
177
  - !ruby/object:Gem::Version
150
- version: '1.1'
178
+ version: '6.3'
151
179
  - !ruby/object:Gem::Dependency
152
180
  name: rexical
153
181
  requirement: !ruby/object:Gem::Requirement
154
182
  requirements:
155
183
  - - "~>"
156
184
  - !ruby/object:Gem::Version
157
- version: 1.0.5
185
+ version: 1.0.7
158
186
  type: :development
159
187
  prerelease: false
160
188
  version_requirements: !ruby/object:Gem::Requirement
161
189
  requirements:
162
190
  - - "~>"
163
191
  - !ruby/object:Gem::Version
164
- version: 1.0.5
192
+ version: 1.0.7
165
193
  - !ruby/object:Gem::Dependency
166
194
  name: rubocop
167
195
  requirement: !ruby/object:Gem::Requirement
168
196
  requirements:
169
197
  - - "~>"
170
198
  - !ruby/object:Gem::Version
171
- version: '1.7'
199
+ version: 1.30.1
172
200
  type: :development
173
201
  prerelease: false
174
202
  version_requirements: !ruby/object:Gem::Requirement
175
203
  requirements:
176
204
  - - "~>"
177
205
  - !ruby/object:Gem::Version
178
- version: '1.7'
206
+ version: 1.30.1
179
207
  - !ruby/object:Gem::Dependency
180
- name: simplecov
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
181
223
  requirement: !ruby/object:Gem::Requirement
182
224
  requirements:
183
225
  - - "~>"
184
226
  - !ruby/object:Gem::Version
185
- version: '0.20'
227
+ version: '1.12'
186
228
  type: :development
187
229
  prerelease: false
188
230
  version_requirements: !ruby/object:Gem::Requirement
189
231
  requirements:
190
232
  - - "~>"
191
233
  - !ruby/object:Gem::Version
192
- version: '0.20'
234
+ version: '1.12'
193
235
  - !ruby/object:Gem::Dependency
194
- name: yard
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
195
279
  requirement: !ruby/object:Gem::Requirement
196
280
  requirements:
197
281
  - - "~>"
198
282
  - !ruby/object:Gem::Version
199
- version: '0.9'
283
+ version: '0.21'
200
284
  type: :development
201
285
  prerelease: false
202
286
  version_requirements: !ruby/object:Gem::Requirement
203
287
  requirements:
204
288
  - - "~>"
205
289
  - !ruby/object:Gem::Version
206
- version: '0.9'
290
+ version: '0.21'
207
291
  description: |
208
292
  Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a
209
293
  sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is
@@ -341,6 +425,7 @@ files:
341
425
  - gumbo-parser/src/vector.c
342
426
  - gumbo-parser/src/vector.h
343
427
  - lib/nokogiri.rb
428
+ - lib/nokogiri/class_resolver.rb
344
429
  - lib/nokogiri/css.rb
345
430
  - lib/nokogiri/css/node.rb
346
431
  - lib/nokogiri/css/parser.rb
@@ -416,14 +501,11 @@ files:
416
501
  - patches/libxml2/0001-Remove-script-macro-support.patch
417
502
  - patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
418
503
  - patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
419
- - patches/libxml2/0004-use-glibc-strlen.patch
420
504
  - patches/libxml2/0005-avoid-isnan-isinf.patch
421
- - patches/libxml2/0006-update-automake-files-for-arm64.patch
422
- - patches/libxml2/0007-Fix-XPath-recursion-limit.patch
505
+ - patches/libxml2/0009-allow-wildcard-namespaces.patch
423
506
  - patches/libxslt/0001-update-automake-files-for-arm64.patch
424
- - patches/libxslt/0002-Fix-xml2-config-check-in-configure-script.patch
425
- - ports/archives/libxml2-2.9.12.tar.gz
426
- - ports/archives/libxslt-1.1.34.tar.gz
507
+ - ports/archives/libxml2-2.10.3.tar.xz
508
+ - ports/archives/libxslt-1.1.37.tar.xz
427
509
  homepage: https://nokogiri.org
428
510
  licenses:
429
511
  - MIT
@@ -433,6 +515,7 @@ metadata:
433
515
  documentation_uri: https://nokogiri.org/rdoc/index.html
434
516
  changelog_uri: https://nokogiri.org/CHANGELOG.html
435
517
  source_code_uri: https://github.com/sparklemotion/nokogiri
518
+ rubygems_mfa_required: 'true'
436
519
  post_install_message:
437
520
  rdoc_options:
438
521
  - "--main"
@@ -443,14 +526,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
443
526
  requirements:
444
527
  - - ">="
445
528
  - !ruby/object:Gem::Version
446
- version: 2.5.0
529
+ version: 2.6.0
447
530
  required_rubygems_version: !ruby/object:Gem::Requirement
448
531
  requirements:
449
532
  - - ">="
450
533
  - !ruby/object:Gem::Version
451
534
  version: '0'
452
535
  requirements: []
453
- rubygems_version: 3.2.22
536
+ rubygems_version: 3.3.7
454
537
  signing_key:
455
538
  specification_version: 4
456
539
  summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
@@ -1,53 +0,0 @@
1
- From c94172d2a4451368530db2186190d70be8a1d9e5 Mon Sep 17 00:00:00 2001
2
- From: Ilya Zub <ilya@serpapi.com>
3
- Date: Wed, 23 Dec 2020 12:45:29 +0200
4
- Subject: Use glibc strlen to speed up xmlStrlen
5
- MIME-Version: 1.0
6
- Content-Type: text/plain; charset=UTF-8
7
- Content-Transfer-Encoding: 8bit
8
-
9
- xmlStrlen (entire HTML file): 926171.936981 μs
10
- glibc_xmlStrlen (entire HTML file): 36905.903992 μs
11
- delta (xmlStrlen ÷ glibc_xmlStrlen): 25.094584 times
12
-
13
- xmlStrlen (average string): 57479.204010 μs
14
- glibc_xmlStrlen (average string): 5802.069000 μs
15
- delta (xmlStrlen ÷ glibc_xmlStrlen): 9.905937 times
16
-
17
- xmlStrlen (bigger string): 388056.315979 μs
18
- glibc_xmlStrlen (bigger string): 12797.856995 μs
19
- delta (xmlStrlen ÷ glibc_xmlStrlen): 30.318382 times
20
-
21
- xmlStrlen (smallest string): 15870.046021 μs
22
- glibc_xmlStrlen (smallest string): 6282.208984 μs
23
- delta (xmlStrlen ÷ glibc_xmlStrlen): 2.527903 times
24
-
25
- See https://gitlab.gnome.org/GNOME/libxml2/-/issues/212 for reference.
26
- ---
27
- xmlstring.c | 9 ++-------
28
- 1 file changed, 2 insertions(+), 7 deletions(-)
29
-
30
- diff --git a/xmlstring.c b/xmlstring.c
31
- index e8a1e45d..df247dff 100644
32
- --- a/xmlstring.c
33
- +++ b/xmlstring.c
34
- @@ -423,14 +423,9 @@ xmlStrsub(const xmlChar *str, int start, int len) {
35
-
36
- int
37
- xmlStrlen(const xmlChar *str) {
38
- - int len = 0;
39
- -
40
- if (str == NULL) return(0);
41
- - while (*str != 0) { /* non input consuming */
42
- - str++;
43
- - len++;
44
- - }
45
- - return(len);
46
- +
47
- + return strlen((const char*)str);
48
- }
49
-
50
- /**
51
- --
52
- 2.29.2
53
-