nokogiri 1.11.2 → 1.12.5

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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE-DEPENDENCIES.md +243 -22
  3. data/LICENSE.md +1 -1
  4. data/README.md +7 -6
  5. data/dependencies.yml +12 -12
  6. data/ext/nokogiri/depend +35 -34
  7. data/ext/nokogiri/extconf.rb +185 -103
  8. data/ext/nokogiri/gumbo.c +584 -0
  9. data/ext/nokogiri/{html_document.c → html4_document.c} +8 -8
  10. data/ext/nokogiri/{html_element_description.c → html4_element_description.c} +21 -19
  11. data/ext/nokogiri/{html_entity_lookup.c → html4_entity_lookup.c} +7 -7
  12. data/ext/nokogiri/{html_sax_parser_context.c → html4_sax_parser_context.c} +6 -5
  13. data/ext/nokogiri/{html_sax_push_parser.c → html4_sax_push_parser.c} +4 -4
  14. data/ext/nokogiri/libxml2_backwards_compat.c +30 -30
  15. data/ext/nokogiri/nokogiri.c +70 -38
  16. data/ext/nokogiri/nokogiri.h +19 -9
  17. data/ext/nokogiri/xml_document.c +50 -49
  18. data/ext/nokogiri/xml_element_content.c +2 -0
  19. data/ext/nokogiri/xml_encoding_handler.c +11 -6
  20. data/ext/nokogiri/xml_namespace.c +4 -2
  21. data/ext/nokogiri/xml_node.c +147 -133
  22. data/ext/nokogiri/xml_node_set.c +20 -20
  23. data/ext/nokogiri/xml_reader.c +2 -0
  24. data/ext/nokogiri/xml_sax_parser.c +6 -6
  25. data/ext/nokogiri/xml_sax_parser_context.c +2 -0
  26. data/ext/nokogiri/xml_schema.c +2 -0
  27. data/ext/nokogiri/xml_xpath_context.c +67 -65
  28. data/ext/nokogiri/xslt_stylesheet.c +2 -1
  29. data/gumbo-parser/CHANGES.md +63 -0
  30. data/gumbo-parser/Makefile +101 -0
  31. data/gumbo-parser/THANKS +27 -0
  32. data/gumbo-parser/src/Makefile +34 -0
  33. data/gumbo-parser/src/README.md +41 -0
  34. data/gumbo-parser/src/ascii.c +75 -0
  35. data/gumbo-parser/src/ascii.h +115 -0
  36. data/gumbo-parser/src/attribute.c +42 -0
  37. data/gumbo-parser/src/attribute.h +17 -0
  38. data/gumbo-parser/src/char_ref.c +22225 -0
  39. data/gumbo-parser/src/char_ref.h +29 -0
  40. data/gumbo-parser/src/char_ref.rl +2154 -0
  41. data/gumbo-parser/src/error.c +626 -0
  42. data/gumbo-parser/src/error.h +148 -0
  43. data/gumbo-parser/src/foreign_attrs.c +104 -0
  44. data/gumbo-parser/src/foreign_attrs.gperf +27 -0
  45. data/gumbo-parser/src/gumbo.h +943 -0
  46. data/gumbo-parser/src/insertion_mode.h +33 -0
  47. data/gumbo-parser/src/macros.h +91 -0
  48. data/gumbo-parser/src/parser.c +4886 -0
  49. data/gumbo-parser/src/parser.h +41 -0
  50. data/gumbo-parser/src/replacement.h +33 -0
  51. data/gumbo-parser/src/string_buffer.c +103 -0
  52. data/gumbo-parser/src/string_buffer.h +68 -0
  53. data/gumbo-parser/src/string_piece.c +48 -0
  54. data/gumbo-parser/src/svg_attrs.c +174 -0
  55. data/gumbo-parser/src/svg_attrs.gperf +77 -0
  56. data/gumbo-parser/src/svg_tags.c +137 -0
  57. data/gumbo-parser/src/svg_tags.gperf +55 -0
  58. data/gumbo-parser/src/tag.c +222 -0
  59. data/gumbo-parser/src/tag_lookup.c +382 -0
  60. data/gumbo-parser/src/tag_lookup.gperf +169 -0
  61. data/gumbo-parser/src/tag_lookup.h +13 -0
  62. data/gumbo-parser/src/token_buffer.c +79 -0
  63. data/gumbo-parser/src/token_buffer.h +71 -0
  64. data/gumbo-parser/src/token_type.h +17 -0
  65. data/gumbo-parser/src/tokenizer.c +3463 -0
  66. data/gumbo-parser/src/tokenizer.h +112 -0
  67. data/gumbo-parser/src/tokenizer_states.h +339 -0
  68. data/gumbo-parser/src/utf8.c +245 -0
  69. data/gumbo-parser/src/utf8.h +164 -0
  70. data/gumbo-parser/src/util.c +68 -0
  71. data/gumbo-parser/src/util.h +30 -0
  72. data/gumbo-parser/src/vector.c +111 -0
  73. data/gumbo-parser/src/vector.h +45 -0
  74. data/lib/nokogiri/css/parser.rb +1 -1
  75. data/lib/nokogiri/css/parser.y +1 -1
  76. data/lib/nokogiri/css/syntax_error.rb +1 -1
  77. data/lib/nokogiri/css.rb +14 -14
  78. data/lib/nokogiri/extension.rb +7 -2
  79. data/lib/nokogiri/gumbo.rb +14 -0
  80. data/lib/nokogiri/html.rb +31 -27
  81. data/lib/nokogiri/{html → html4}/builder.rb +2 -2
  82. data/lib/nokogiri/{html → html4}/document.rb +4 -4
  83. data/lib/nokogiri/{html → html4}/document_fragment.rb +3 -3
  84. data/lib/nokogiri/{html → html4}/element_description.rb +1 -1
  85. data/lib/nokogiri/{html → html4}/element_description_defaults.rb +1 -1
  86. data/lib/nokogiri/{html → html4}/entity_lookup.rb +1 -1
  87. data/lib/nokogiri/{html → html4}/sax/parser.rb +11 -14
  88. data/lib/nokogiri/html4/sax/parser_context.rb +19 -0
  89. data/lib/nokogiri/{html → html4}/sax/push_parser.rb +5 -5
  90. data/lib/nokogiri/html4.rb +40 -0
  91. data/lib/nokogiri/html5/document.rb +74 -0
  92. data/lib/nokogiri/html5/document_fragment.rb +80 -0
  93. data/lib/nokogiri/html5/node.rb +93 -0
  94. data/lib/nokogiri/html5.rb +473 -0
  95. data/lib/nokogiri/version/constant.rb +1 -1
  96. data/lib/nokogiri/version/info.rb +12 -2
  97. data/lib/nokogiri/xml/builder.rb +38 -0
  98. data/lib/nokogiri/xml/document.rb +89 -17
  99. data/lib/nokogiri/xml/node/save_options.rb +1 -1
  100. data/lib/nokogiri/xml/node.rb +7 -5
  101. data/lib/nokogiri/xml/parse_options.rb +2 -0
  102. data/lib/nokogiri/xml/pp.rb +2 -2
  103. data/lib/nokogiri/xml/sax/document.rb +24 -30
  104. data/lib/nokogiri/xml/sax.rb +4 -4
  105. data/lib/nokogiri/xml/xpath.rb +2 -2
  106. data/lib/nokogiri/xml.rb +35 -36
  107. data/lib/nokogiri/xslt/stylesheet.rb +1 -1
  108. data/lib/nokogiri/xslt.rb +16 -16
  109. data/lib/nokogiri.rb +31 -29
  110. data/patches/libxml2/{0002-Remove-script-macro-support.patch → 0001-Remove-script-macro-support.patch} +0 -0
  111. data/patches/libxml2/{0003-Update-entities-to-remove-handling-of-ssi.patch → 0002-Update-entities-to-remove-handling-of-ssi.patch} +0 -0
  112. data/patches/libxml2/{0004-libxml2.la-is-in-top_builddir.patch → 0003-libxml2.la-is-in-top_builddir.patch} +1 -1
  113. data/patches/libxml2/{0008-use-glibc-strlen.patch → 0004-use-glibc-strlen.patch} +0 -0
  114. data/patches/libxml2/{0009-avoid-isnan-isinf.patch → 0005-avoid-isnan-isinf.patch} +4 -4
  115. data/patches/libxml2/0006-update-automake-files-for-arm64.patch +2511 -0
  116. data/patches/libxml2/0007-Fix-XPath-recursion-limit.patch +31 -0
  117. data/patches/libxslt/0001-update-automake-files-for-arm64.patch +2511 -0
  118. data/patches/libxslt/0002-Fix-xml2-config-check-in-configure-script.patch +19 -0
  119. data/ports/archives/libxml2-2.9.12.tar.gz +0 -0
  120. metadata +110 -69
  121. data/lib/nokogiri/html/sax/parser_context.rb +0 -17
  122. data/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch +0 -78
  123. data/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch +0 -32
  124. data/patches/libxml2/0006-htmlParseComment-treat-as-if-it-closed-the-comment.patch +0 -73
  125. data/patches/libxml2/0007-use-new-htmlParseLookupCommentEnd-to-find-comment-en.patch +0 -103
  126. data/patches/libxml2/0010-parser.c-shrink-the-input-buffer-when-appropriate.patch +0 -70
  127. data/ports/archives/libxml2-2.9.10.tar.gz +0 -0
@@ -0,0 +1,19 @@
1
+ From: Nick Wellnhofer <wellnhofer@aevum.de>
2
+ Date: Fri, 15 Nov 2019 11:53:11 +0100
3
+ Subject: [PATCH] Fix xml2-config check in configure script
4
+
5
+ A 'print' option has never been supported. After a recent change to
6
+ libxml2, invalid options cause xml2-config to fail.
7
+ diff --git a/configure b/configure
8
+ index c63adc5..6061227 100755
9
+ --- a/configure
10
+ +++ b/configure
11
+ @@ -14860,7 +14860,7 @@ PKG_CONFIG=$_save_PKG_CONFIG
12
+ fi
13
+
14
+
15
+ -if test "x$LIBXML_LIBS" = "x" && ${XML_CONFIG} --libs print > /dev/null 2>&1
16
+ +if test "x$LIBXML_LIBS" = "x" && ${XML_CONFIG} --libs > /dev/null 2>&1
17
+ then
18
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml libraries >= $LIBXML_REQUIRED_VERSION" >&5
19
+ $as_echo_n "checking for libxml libraries >= $LIBXML_REQUIRED_VERSION... " >&6; }
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.11.2
4
+ version: 1.12.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -10,6 +10,9 @@ authors:
10
10
  - Akinori MUSHA
11
11
  - John Shahid
12
12
  - Karol Bucek
13
+ - Sam Ruby
14
+ - Craig Barnes
15
+ - Stephen Checkoway
13
16
  - Lars Kanis
14
17
  - Sergio Arbeo
15
18
  - Timothy Elliott
@@ -17,7 +20,7 @@ authors:
17
20
  autorequire:
18
21
  bindir: bin
19
22
  cert_chain: []
20
- date: 2021-03-11 00:00:00.000000000 Z
23
+ date: 2021-09-27 00:00:00.000000000 Z
21
24
  dependencies:
22
25
  - !ruby/object:Gem::Dependency
23
26
  name: racc
@@ -39,14 +42,14 @@ dependencies:
39
42
  requirements:
40
43
  - - "~>"
41
44
  - !ruby/object:Gem::Version
42
- version: 2.5.0
45
+ version: 2.6.1
43
46
  type: :runtime
44
47
  prerelease: false
45
48
  version_requirements: !ruby/object:Gem::Requirement
46
49
  requirements:
47
50
  - - "~>"
48
51
  - !ruby/object:Gem::Version
49
- version: 2.5.0
52
+ version: 2.6.1
50
53
  - !ruby/object:Gem::Dependency
51
54
  name: bundler
52
55
  requirement: !ruby/object:Gem::Requirement
@@ -61,20 +64,6 @@ dependencies:
61
64
  - - "~>"
62
65
  - !ruby/object:Gem::Version
63
66
  version: '2.2'
64
- - !ruby/object:Gem::Dependency
65
- name: concourse
66
- requirement: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - "~>"
69
- - !ruby/object:Gem::Version
70
- version: '0.41'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '0.41'
78
67
  - !ruby/object:Gem::Dependency
79
68
  name: hoe-markdown
80
69
  requirement: !ruby/object:Gem::Requirement
@@ -225,40 +214,41 @@ executables:
225
214
  extensions:
226
215
  - ext/nokogiri/extconf.rb
227
216
  extra_rdoc_files:
228
- - ext/nokogiri/xml_dtd.c
229
- - ext/nokogiri/xml_xpath_context.c
230
- - ext/nokogiri/xml_attr.c
217
+ - ext/nokogiri/gumbo.c
218
+ - ext/nokogiri/html4_document.c
219
+ - ext/nokogiri/html4_element_description.c
220
+ - ext/nokogiri/html4_entity_lookup.c
221
+ - ext/nokogiri/html4_sax_parser_context.c
222
+ - ext/nokogiri/html4_sax_push_parser.c
231
223
  - ext/nokogiri/libxml2_backwards_compat.c
232
- - ext/nokogiri/xml_comment.c
233
224
  - ext/nokogiri/nokogiri.c
234
- - ext/nokogiri/xml_sax_parser_context.c
235
- - ext/nokogiri/xml_node_set.c
236
- - ext/nokogiri/xml_reader.c
225
+ - ext/nokogiri/test_global_handlers.c
226
+ - ext/nokogiri/xml_attr.c
227
+ - ext/nokogiri/xml_attribute_decl.c
237
228
  - ext/nokogiri/xml_cdata.c
238
- - ext/nokogiri/xml_element_content.c
239
- - ext/nokogiri/html_entity_lookup.c
240
- - ext/nokogiri/xml_namespace.c
229
+ - ext/nokogiri/xml_comment.c
241
230
  - ext/nokogiri/xml_document.c
242
- - ext/nokogiri/xml_element_decl.c
243
- - ext/nokogiri/xml_schema.c
244
- - ext/nokogiri/html_document.c
245
- - ext/nokogiri/xml_processing_instruction.c
246
- - ext/nokogiri/xml_text.c
247
- - ext/nokogiri/xml_syntax_error.c
248
231
  - ext/nokogiri/xml_document_fragment.c
249
- - ext/nokogiri/xml_sax_push_parser.c
232
+ - ext/nokogiri/xml_dtd.c
233
+ - ext/nokogiri/xml_element_content.c
234
+ - ext/nokogiri/xml_element_decl.c
250
235
  - ext/nokogiri/xml_encoding_handler.c
251
- - ext/nokogiri/html_sax_push_parser.c
252
- - ext/nokogiri/xml_relax_ng.c
253
236
  - ext/nokogiri/xml_entity_decl.c
254
- - ext/nokogiri/test_global_handlers.c
255
- - ext/nokogiri/xml_node.c
256
237
  - ext/nokogiri/xml_entity_reference.c
257
- - ext/nokogiri/xslt_stylesheet.c
258
- - ext/nokogiri/html_sax_parser_context.c
238
+ - ext/nokogiri/xml_namespace.c
239
+ - ext/nokogiri/xml_node.c
240
+ - ext/nokogiri/xml_node_set.c
241
+ - ext/nokogiri/xml_processing_instruction.c
242
+ - ext/nokogiri/xml_reader.c
243
+ - ext/nokogiri/xml_relax_ng.c
259
244
  - ext/nokogiri/xml_sax_parser.c
260
- - ext/nokogiri/xml_attribute_decl.c
261
- - ext/nokogiri/html_element_description.c
245
+ - ext/nokogiri/xml_sax_parser_context.c
246
+ - ext/nokogiri/xml_sax_push_parser.c
247
+ - ext/nokogiri/xml_schema.c
248
+ - ext/nokogiri/xml_syntax_error.c
249
+ - ext/nokogiri/xml_text.c
250
+ - ext/nokogiri/xml_xpath_context.c
251
+ - ext/nokogiri/xslt_stylesheet.c
262
252
  - README.md
263
253
  files:
264
254
  - Gemfile
@@ -269,11 +259,12 @@ files:
269
259
  - dependencies.yml
270
260
  - ext/nokogiri/depend
271
261
  - ext/nokogiri/extconf.rb
272
- - ext/nokogiri/html_document.c
273
- - ext/nokogiri/html_element_description.c
274
- - ext/nokogiri/html_entity_lookup.c
275
- - ext/nokogiri/html_sax_parser_context.c
276
- - ext/nokogiri/html_sax_push_parser.c
262
+ - ext/nokogiri/gumbo.c
263
+ - ext/nokogiri/html4_document.c
264
+ - ext/nokogiri/html4_element_description.c
265
+ - ext/nokogiri/html4_entity_lookup.c
266
+ - ext/nokogiri/html4_sax_parser_context.c
267
+ - ext/nokogiri/html4_sax_push_parser.c
277
268
  - ext/nokogiri/libxml2_backwards_compat.c
278
269
  - ext/nokogiri/nokogiri.c
279
270
  - ext/nokogiri/nokogiri.h
@@ -304,6 +295,51 @@ files:
304
295
  - ext/nokogiri/xml_text.c
305
296
  - ext/nokogiri/xml_xpath_context.c
306
297
  - ext/nokogiri/xslt_stylesheet.c
298
+ - gumbo-parser/CHANGES.md
299
+ - gumbo-parser/Makefile
300
+ - gumbo-parser/THANKS
301
+ - gumbo-parser/src/Makefile
302
+ - gumbo-parser/src/README.md
303
+ - gumbo-parser/src/ascii.c
304
+ - gumbo-parser/src/ascii.h
305
+ - gumbo-parser/src/attribute.c
306
+ - gumbo-parser/src/attribute.h
307
+ - gumbo-parser/src/char_ref.c
308
+ - gumbo-parser/src/char_ref.h
309
+ - gumbo-parser/src/char_ref.rl
310
+ - gumbo-parser/src/error.c
311
+ - gumbo-parser/src/error.h
312
+ - gumbo-parser/src/foreign_attrs.c
313
+ - gumbo-parser/src/foreign_attrs.gperf
314
+ - gumbo-parser/src/gumbo.h
315
+ - gumbo-parser/src/insertion_mode.h
316
+ - gumbo-parser/src/macros.h
317
+ - gumbo-parser/src/parser.c
318
+ - gumbo-parser/src/parser.h
319
+ - gumbo-parser/src/replacement.h
320
+ - gumbo-parser/src/string_buffer.c
321
+ - gumbo-parser/src/string_buffer.h
322
+ - gumbo-parser/src/string_piece.c
323
+ - gumbo-parser/src/svg_attrs.c
324
+ - gumbo-parser/src/svg_attrs.gperf
325
+ - gumbo-parser/src/svg_tags.c
326
+ - gumbo-parser/src/svg_tags.gperf
327
+ - gumbo-parser/src/tag.c
328
+ - gumbo-parser/src/tag_lookup.c
329
+ - gumbo-parser/src/tag_lookup.gperf
330
+ - gumbo-parser/src/tag_lookup.h
331
+ - gumbo-parser/src/token_buffer.c
332
+ - gumbo-parser/src/token_buffer.h
333
+ - gumbo-parser/src/token_type.h
334
+ - gumbo-parser/src/tokenizer.c
335
+ - gumbo-parser/src/tokenizer.h
336
+ - gumbo-parser/src/tokenizer_states.h
337
+ - gumbo-parser/src/utf8.c
338
+ - gumbo-parser/src/utf8.h
339
+ - gumbo-parser/src/util.c
340
+ - gumbo-parser/src/util.h
341
+ - gumbo-parser/src/vector.c
342
+ - gumbo-parser/src/vector.h
307
343
  - lib/nokogiri.rb
308
344
  - lib/nokogiri/css.rb
309
345
  - lib/nokogiri/css/node.rb
@@ -316,16 +352,22 @@ files:
316
352
  - lib/nokogiri/css/xpath_visitor.rb
317
353
  - lib/nokogiri/decorators/slop.rb
318
354
  - lib/nokogiri/extension.rb
355
+ - lib/nokogiri/gumbo.rb
319
356
  - lib/nokogiri/html.rb
320
- - lib/nokogiri/html/builder.rb
321
- - lib/nokogiri/html/document.rb
322
- - lib/nokogiri/html/document_fragment.rb
323
- - lib/nokogiri/html/element_description.rb
324
- - lib/nokogiri/html/element_description_defaults.rb
325
- - lib/nokogiri/html/entity_lookup.rb
326
- - lib/nokogiri/html/sax/parser.rb
327
- - lib/nokogiri/html/sax/parser_context.rb
328
- - lib/nokogiri/html/sax/push_parser.rb
357
+ - lib/nokogiri/html4.rb
358
+ - lib/nokogiri/html4/builder.rb
359
+ - lib/nokogiri/html4/document.rb
360
+ - lib/nokogiri/html4/document_fragment.rb
361
+ - lib/nokogiri/html4/element_description.rb
362
+ - lib/nokogiri/html4/element_description_defaults.rb
363
+ - lib/nokogiri/html4/entity_lookup.rb
364
+ - lib/nokogiri/html4/sax/parser.rb
365
+ - lib/nokogiri/html4/sax/parser_context.rb
366
+ - lib/nokogiri/html4/sax/push_parser.rb
367
+ - lib/nokogiri/html5.rb
368
+ - lib/nokogiri/html5/document.rb
369
+ - lib/nokogiri/html5/document_fragment.rb
370
+ - lib/nokogiri/html5/node.rb
329
371
  - lib/nokogiri/jruby/dependencies.rb
330
372
  - lib/nokogiri/syntax_error.rb
331
373
  - lib/nokogiri/version.rb
@@ -371,17 +413,16 @@ files:
371
413
  - lib/nokogiri/xslt.rb
372
414
  - lib/nokogiri/xslt/stylesheet.rb
373
415
  - lib/xsd/xmlparser/nokogiri.rb
374
- - patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
375
- - patches/libxml2/0002-Remove-script-macro-support.patch
376
- - patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch
377
- - patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch
378
- - patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch
379
- - patches/libxml2/0006-htmlParseComment-treat-as-if-it-closed-the-comment.patch
380
- - patches/libxml2/0007-use-new-htmlParseLookupCommentEnd-to-find-comment-en.patch
381
- - patches/libxml2/0008-use-glibc-strlen.patch
382
- - patches/libxml2/0009-avoid-isnan-isinf.patch
383
- - patches/libxml2/0010-parser.c-shrink-the-input-buffer-when-appropriate.patch
384
- - ports/archives/libxml2-2.9.10.tar.gz
416
+ - patches/libxml2/0001-Remove-script-macro-support.patch
417
+ - patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
418
+ - patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
419
+ - patches/libxml2/0004-use-glibc-strlen.patch
420
+ - 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
423
+ - 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
385
426
  - ports/archives/libxslt-1.1.34.tar.gz
386
427
  homepage: https://nokogiri.org
387
428
  licenses:
@@ -409,7 +450,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
409
450
  - !ruby/object:Gem::Version
410
451
  version: '0'
411
452
  requirements: []
412
- rubygems_version: 3.1.4
453
+ rubygems_version: 3.2.22
413
454
  signing_key:
414
455
  specification_version: 4
415
456
  summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
- module Nokogiri
3
- module HTML
4
- module SAX
5
- ###
6
- # Context for HTML SAX parsers. This class is usually not instantiated
7
- # by the user. Instead, you should be looking at
8
- # Nokogiri::HTML::SAX::Parser
9
- class ParserContext < Nokogiri::XML::SAX::ParserContext
10
- def self.new thing, encoding = 'UTF-8'
11
- [:read, :close].all? { |x| thing.respond_to?(x) } ? super :
12
- memory(thing, encoding)
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,78 +0,0 @@
1
- From c5538465c08a8ea248a370bf55bc39cd3385e4af Mon Sep 17 00:00:00 2001
2
- From: Mike Dalessio <mike.dalessio@gmail.com>
3
- Date: Thu, 29 Mar 2018 14:09:00 -0400
4
- Subject: [PATCH] Revert "Do not URI escape in server side includes"
5
-
6
- This reverts commit 960f0e275616cadc29671a218d7fb9b69eb35588.
7
- ---
8
- HTMLtree.c | 49 +++++++++++--------------------------------------
9
- 1 file changed, 11 insertions(+), 38 deletions(-)
10
-
11
- diff --git a/HTMLtree.c b/HTMLtree.c
12
- index 2fd0c9c..67160c5 100644
13
- --- a/HTMLtree.c
14
- +++ b/HTMLtree.c
15
- @@ -717,49 +717,22 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
16
- (!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
17
- ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
18
- (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
19
- + xmlChar *escaped;
20
- xmlChar *tmp = value;
21
- - /* xmlURIEscapeStr() escapes '"' so it can be safely used. */
22
- - xmlBufCCat(buf->buffer, "\"");
23
-
24
- while (IS_BLANK_CH(*tmp)) tmp++;
25
-
26
- - /* URI Escape everything, except server side includes. */
27
- - for ( ; ; ) {
28
- - xmlChar *escaped;
29
- - xmlChar endChar;
30
- - xmlChar *end = NULL;
31
- - xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST "<!--");
32
- - if (start != NULL) {
33
- - end = (xmlChar *)xmlStrstr(tmp, BAD_CAST "-->");
34
- - if (end != NULL) {
35
- - *start = '\0';
36
- - }
37
- - }
38
- -
39
- - /* Escape the whole string, or until start (set to '\0'). */
40
- - escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
41
- - if (escaped != NULL) {
42
- - xmlBufCat(buf->buffer, escaped);
43
- - xmlFree(escaped);
44
- - } else {
45
- - xmlBufCat(buf->buffer, tmp);
46
- - }
47
- -
48
- - if (end == NULL) { /* Everything has been written. */
49
- - break;
50
- - }
51
- -
52
- - /* Do not escape anything within server side includes. */
53
- - *start = '<'; /* Restore the first character of "<!--". */
54
- - end += 3; /* strlen("-->") */
55
- - endChar = *end;
56
- - *end = '\0';
57
- - xmlBufCat(buf->buffer, start);
58
- - *end = endChar;
59
- - tmp = end;
60
- + /*
61
- + * the < and > have already been escaped at the entity level
62
- + * And doing so here breaks server side includes
63
- + */
64
- + escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+<>");
65
- + if (escaped != NULL) {
66
- + xmlBufWriteQuotedString(buf->buffer, escaped);
67
- + xmlFree(escaped);
68
- + } else {
69
- + xmlBufWriteQuotedString(buf->buffer, value);
70
- }
71
- -
72
- - xmlBufCCat(buf->buffer, "\"");
73
- } else {
74
- xmlBufWriteQuotedString(buf->buffer, value);
75
- }
76
- --
77
- 2.9.5
78
-
@@ -1,32 +0,0 @@
1
- From 0e1a49c8907645d2e155f0d89d4d9895ac5112b5 Mon Sep 17 00:00:00 2001
2
- From: Zhipeng Xie <xiezhipeng1@huawei.com>
3
- Date: Thu, 12 Dec 2019 17:30:55 +0800
4
- Subject: [PATCH] Fix infinite loop in xmlStringLenDecodeEntities
5
-
6
- When ctxt->instate == XML_PARSER_EOF,xmlParseStringEntityRef
7
- return NULL which cause a infinite loop in xmlStringLenDecodeEntities
8
-
9
- Found with libFuzzer.
10
-
11
- Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
12
- ---
13
- parser.c | 3 ++-
14
- 1 file changed, 2 insertions(+), 1 deletion(-)
15
-
16
- diff --git a/parser.c b/parser.c
17
- index d1c3196..a34bb6c 100644
18
- --- a/parser.c
19
- +++ b/parser.c
20
- @@ -2646,7 +2646,8 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
21
- else
22
- c = 0;
23
- while ((c != 0) && (c != end) && /* non input consuming loop */
24
- - (c != end2) && (c != end3)) {
25
- + (c != end2) && (c != end3) &&
26
- + (ctxt->instate != XML_PARSER_EOF)) {
27
-
28
- if (c == 0) break;
29
- if ((c == '&') && (str[1] == '#')) {
30
- --
31
- 2.17.1
32
-
@@ -1,73 +0,0 @@
1
- From 4f51a6d2b1755ce5b36c524c215aad70d864ac1d Mon Sep 17 00:00:00 2001
2
- From: Mike Dalessio <mike.dalessio@gmail.com>
3
- Date: Mon, 3 Aug 2020 17:36:05 -0400
4
- Subject: [PATCH 1/2] htmlParseComment: treat `--!>` as if it closed the
5
- comment
6
-
7
- See guidance provided on incorrectly-closed comments here:
8
-
9
- https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment
10
- ---
11
- HTMLparser.c | 28 ++++++++++++++++++++--------
12
- 1 file changed, 20 insertions(+), 8 deletions(-)
13
-
14
- diff --git a/HTMLparser.c b/HTMLparser.c
15
- index 7b6d689..4d43479 100644
16
- --- a/HTMLparser.c
17
- +++ b/HTMLparser.c
18
- @@ -3300,6 +3300,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
19
- int q, ql;
20
- int r, rl;
21
- int cur, l;
22
- + int next, nl;
23
- xmlParserInputState state;
24
-
25
- /*
26
- @@ -3332,6 +3333,21 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
27
- while (IS_CHAR(cur) &&
28
- ((cur != '>') ||
29
- (r != '-') || (q != '-'))) {
30
- + NEXTL(l);
31
- + next = CUR_CHAR(nl);
32
- + if (next == 0) {
33
- + SHRINK;
34
- + GROW;
35
- + next = CUR_CHAR(nl);
36
- + }
37
- +
38
- + if ((q == '-') && (r == '-') && (cur == '!') && (next == '>')) {
39
- + htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
40
- + "Comment incorrectly closed by '--!>'", NULL, NULL);
41
- + cur = '>';
42
- + break;
43
- + }
44
- +
45
- if (len + 5 >= size) {
46
- xmlChar *tmp;
47
-
48
- @@ -3345,18 +3361,14 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
49
- }
50
- buf = tmp;
51
- }
52
- - COPY_BUF(ql,buf,len,q);
53
- + COPY_BUF(ql,buf,len,q);
54
- +
55
- q = r;
56
- ql = rl;
57
- r = cur;
58
- rl = l;
59
- - NEXTL(l);
60
- - cur = CUR_CHAR(l);
61
- - if (cur == 0) {
62
- - SHRINK;
63
- - GROW;
64
- - cur = CUR_CHAR(l);
65
- - }
66
- + cur = next;
67
- + l = nl;
68
- }
69
- buf[len] = 0;
70
- if (IS_CHAR(cur)) {
71
- --
72
- 2.25.1
73
-
@@ -1,103 +0,0 @@
1
- From b20d746fa7cbb74716171bc49d836af99927e41e Mon Sep 17 00:00:00 2001
2
- From: Mike Dalessio <mike.dalessio@gmail.com>
3
- Date: Sun, 11 Oct 2020 14:15:37 -0400
4
- Subject: [PATCH 2/2] use new htmlParseLookupCommentEnd to find comment ends
5
-
6
- Note that the caret in error messages generated during comment parsing
7
- may have moved by one byte.
8
-
9
- See guidance provided on incorrectly-closed comments here:
10
-
11
- https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment
12
- ---
13
- HTMLparser.c | 46 +++++++++++++++++++++++++++++++++++++---------
14
- 1 file changed, 37 insertions(+), 9 deletions(-)
15
-
16
- diff --git a/HTMLparser.c b/HTMLparser.c
17
- index 4d43479..000dc3d 100644
18
- --- a/HTMLparser.c
19
- +++ b/HTMLparser.c
20
- @@ -5331,6 +5331,39 @@ htmlParseLookupChars(htmlParserCtxtPtr ctxt, const xmlChar * stop,
21
- return (-1);
22
- }
23
-
24
- +/**
25
- + * htmlParseLookupCommentEnd:
26
- + * @ctxt: an HTML parser context
27
- + *
28
- + * Try to find a comment end tag in the input stream
29
- + * The search includes "-->" as well as WHATWG-recommended incorrectly-closed tags.
30
- + * (See https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment)
31
- + * This function has a side effect of (possibly) incrementing ctxt->checkIndex
32
- + * to avoid rescanning sequences of bytes, it DOES change the state of the
33
- + * parser, do not use liberally.
34
- + * This wraps to htmlParseLookupSequence()
35
- + *
36
- + * Returns the index to the current parsing point if the full sequence is available, -1 otherwise.
37
- + */
38
- +static int
39
- +htmlParseLookupCommentEnd(htmlParserCtxtPtr ctxt)
40
- +{
41
- + int mark = 0;
42
- + int cur = CUR_PTR - BASE_PTR;
43
- +
44
- + while (mark >= 0) {
45
- + mark = htmlParseLookupSequence(ctxt, '-', '-', 0, 1, 1);
46
- + if ((mark < 0) ||
47
- + (NXT(mark+2) == '>') ||
48
- + ((NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
49
- + return mark;
50
- + }
51
- + ctxt->checkIndex = cur + mark + 1;
52
- + }
53
- + return mark;
54
- +}
55
- +
56
- +
57
- /**
58
- * htmlParseTryOrFinish:
59
- * @ctxt: an HTML parser context
60
- @@ -5507,8 +5540,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
61
- cur = in->cur[0];
62
- if ((cur == '<') && (next == '!') &&
63
- (in->cur[2] == '-') && (in->cur[3] == '-')) {
64
- - if ((!terminate) &&
65
- - (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
66
- + if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
67
- goto done;
68
- #ifdef DEBUG_PUSH
69
- xmlGenericError(xmlGenericErrorContext,
70
- @@ -5567,8 +5599,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
71
- next = in->cur[1];
72
- if ((cur == '<') && (next == '!') &&
73
- (in->cur[2] == '-') && (in->cur[3] == '-')) {
74
- - if ((!terminate) &&
75
- - (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
76
- + if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
77
- goto done;
78
- #ifdef DEBUG_PUSH
79
- xmlGenericError(xmlGenericErrorContext,
80
- @@ -5614,8 +5645,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
81
- next = in->cur[1];
82
- if ((cur == '<') && (next == '!') &&
83
- (in->cur[2] == '-') && (in->cur[3] == '-')) {
84
- - if ((!terminate) &&
85
- - (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
86
- + if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
87
- goto done;
88
- #ifdef DEBUG_PUSH
89
- xmlGenericError(xmlGenericErrorContext,
90
- @@ -5871,9 +5901,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
91
- htmlParseDocTypeDecl(ctxt);
92
- } else if ((cur == '<') && (next == '!') &&
93
- (in->cur[2] == '-') && (in->cur[3] == '-')) {
94
- - if ((!terminate) &&
95
- - (htmlParseLookupSequence(
96
- - ctxt, '-', '-', '>', 1, 1) < 0))
97
- + if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
98
- goto done;
99
- #ifdef DEBUG_PUSH
100
- xmlGenericError(xmlGenericErrorContext,
101
- --
102
- 2.25.1
103
-
@@ -1,70 +0,0 @@
1
- From ca565c1edef9a455453fa8564270cc9c5813e1b9 Mon Sep 17 00:00:00 2001
2
- From: Mike Dalessio <mike.dalessio@gmail.com>
3
- Date: Sun, 31 Jan 2021 09:53:56 -0500
4
- Subject: [PATCH] parser.c: shrink the input buffer when appropriate
5
-
6
- Fixes GNOME/libxml2#200
7
-
8
- Also see discussions at:
9
- - GNOME/libxml2#192
10
- - https://gitlab.gnome.org/nwellnhof/libxml2/-/commit/99bda1e
11
- - https://github.com/sparklemotion/nokogiri/issues/2132
12
- ---
13
- parser.c | 6 ++++++
14
- 1 file changed, 6 insertions(+)
15
-
16
- diff --git a/parser.c b/parser.c
17
- index a7bdc7f..efde672 100644
18
- --- a/parser.c
19
- +++ b/parser.c
20
- @@ -4204,6 +4204,7 @@ xmlParseSystemLiteral(xmlParserCtxtPtr ctxt) {
21
- }
22
- count++;
23
- if (count > 50) {
24
- + SHRINK;
25
- GROW;
26
- count = 0;
27
- if (ctxt->instate == XML_PARSER_EOF) {
28
- @@ -4291,6 +4292,7 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
29
- buf[len++] = cur;
30
- count++;
31
- if (count > 50) {
32
- + SHRINK;
33
- GROW;
34
- count = 0;
35
- if (ctxt->instate == XML_PARSER_EOF) {
36
- @@ -4571,6 +4573,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) {
37
- }
38
- count++;
39
- if (count > 50) {
40
- + SHRINK;
41
- GROW;
42
- count = 0;
43
- if (ctxt->instate == XML_PARSER_EOF)
44
- @@ -4776,6 +4779,7 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf,
45
-
46
- count++;
47
- if (count > 50) {
48
- + SHRINK;
49
- GROW;
50
- count = 0;
51
- if (ctxt->instate == XML_PARSER_EOF) {
52
- @@ -5186,6 +5190,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
53
- }
54
- count++;
55
- if (count > 50) {
56
- + SHRINK;
57
- GROW;
58
- if (ctxt->instate == XML_PARSER_EOF) {
59
- xmlFree(buf);
60
- @@ -9783,6 +9788,7 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
61
- sl = l;
62
- count++;
63
- if (count > 50) {
64
- + SHRINK;
65
- GROW;
66
- if (ctxt->instate == XML_PARSER_EOF) {
67
- xmlFree(buf);
68
- --
69
- 2.25.1
70
-
Binary file