nokogiri 1.9.1 → 1.15.3

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 (226) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +45 -0
  3. data/LICENSE-DEPENDENCIES.md +1636 -1024
  4. data/LICENSE.md +5 -28
  5. data/README.md +203 -89
  6. data/bin/nokogiri +63 -50
  7. data/dependencies.yml +33 -61
  8. data/ext/nokogiri/depend +38 -358
  9. data/ext/nokogiri/extconf.rb +864 -418
  10. data/ext/nokogiri/gumbo.c +594 -0
  11. data/ext/nokogiri/html4_document.c +165 -0
  12. data/ext/nokogiri/html4_element_description.c +299 -0
  13. data/ext/nokogiri/html4_entity_lookup.c +37 -0
  14. data/ext/nokogiri/html4_sax_parser_context.c +108 -0
  15. data/ext/nokogiri/html4_sax_push_parser.c +95 -0
  16. data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
  17. data/ext/nokogiri/nokogiri.c +251 -105
  18. data/ext/nokogiri/nokogiri.h +215 -90
  19. data/ext/nokogiri/test_global_handlers.c +40 -0
  20. data/ext/nokogiri/xml_attr.c +17 -17
  21. data/ext/nokogiri/xml_attribute_decl.c +22 -22
  22. data/ext/nokogiri/xml_cdata.c +40 -31
  23. data/ext/nokogiri/xml_comment.c +20 -27
  24. data/ext/nokogiri/xml_document.c +401 -240
  25. data/ext/nokogiri/xml_document_fragment.c +13 -17
  26. data/ext/nokogiri/xml_dtd.c +64 -58
  27. data/ext/nokogiri/xml_element_content.c +63 -55
  28. data/ext/nokogiri/xml_element_decl.c +31 -31
  29. data/ext/nokogiri/xml_encoding_handler.c +54 -21
  30. data/ext/nokogiri/xml_entity_decl.c +37 -35
  31. data/ext/nokogiri/xml_entity_reference.c +17 -19
  32. data/ext/nokogiri/xml_namespace.c +135 -61
  33. data/ext/nokogiri/xml_node.c +1346 -677
  34. data/ext/nokogiri/xml_node_set.c +246 -216
  35. data/ext/nokogiri/xml_processing_instruction.c +18 -20
  36. data/ext/nokogiri/xml_reader.c +347 -212
  37. data/ext/nokogiri/xml_relax_ng.c +86 -77
  38. data/ext/nokogiri/xml_sax_parser.c +149 -124
  39. data/ext/nokogiri/xml_sax_parser_context.c +145 -103
  40. data/ext/nokogiri/xml_sax_push_parser.c +64 -36
  41. data/ext/nokogiri/xml_schema.c +138 -81
  42. data/ext/nokogiri/xml_syntax_error.c +42 -21
  43. data/ext/nokogiri/xml_text.c +36 -26
  44. data/ext/nokogiri/xml_xpath_context.c +366 -178
  45. data/ext/nokogiri/xslt_stylesheet.c +335 -189
  46. data/gumbo-parser/CHANGES.md +63 -0
  47. data/gumbo-parser/Makefile +111 -0
  48. data/gumbo-parser/THANKS +27 -0
  49. data/gumbo-parser/src/Makefile +34 -0
  50. data/gumbo-parser/src/README.md +41 -0
  51. data/gumbo-parser/src/ascii.c +75 -0
  52. data/gumbo-parser/src/ascii.h +115 -0
  53. data/gumbo-parser/src/attribute.c +42 -0
  54. data/gumbo-parser/src/attribute.h +17 -0
  55. data/gumbo-parser/src/char_ref.c +22225 -0
  56. data/gumbo-parser/src/char_ref.h +29 -0
  57. data/gumbo-parser/src/char_ref.rl +2154 -0
  58. data/gumbo-parser/src/error.c +630 -0
  59. data/gumbo-parser/src/error.h +148 -0
  60. data/gumbo-parser/src/foreign_attrs.c +103 -0
  61. data/gumbo-parser/src/foreign_attrs.gperf +27 -0
  62. data/gumbo-parser/src/insertion_mode.h +33 -0
  63. data/gumbo-parser/src/macros.h +91 -0
  64. data/gumbo-parser/src/nokogiri_gumbo.h +944 -0
  65. data/gumbo-parser/src/parser.c +4891 -0
  66. data/gumbo-parser/src/parser.h +41 -0
  67. data/gumbo-parser/src/replacement.h +33 -0
  68. data/gumbo-parser/src/string_buffer.c +103 -0
  69. data/gumbo-parser/src/string_buffer.h +68 -0
  70. data/gumbo-parser/src/string_piece.c +48 -0
  71. data/gumbo-parser/src/svg_attrs.c +174 -0
  72. data/gumbo-parser/src/svg_attrs.gperf +77 -0
  73. data/gumbo-parser/src/svg_tags.c +137 -0
  74. data/gumbo-parser/src/svg_tags.gperf +55 -0
  75. data/gumbo-parser/src/tag.c +223 -0
  76. data/gumbo-parser/src/tag_lookup.c +382 -0
  77. data/gumbo-parser/src/tag_lookup.gperf +170 -0
  78. data/gumbo-parser/src/tag_lookup.h +13 -0
  79. data/gumbo-parser/src/token_buffer.c +79 -0
  80. data/gumbo-parser/src/token_buffer.h +71 -0
  81. data/gumbo-parser/src/token_type.h +17 -0
  82. data/gumbo-parser/src/tokenizer.c +3463 -0
  83. data/gumbo-parser/src/tokenizer.h +112 -0
  84. data/gumbo-parser/src/tokenizer_states.h +339 -0
  85. data/gumbo-parser/src/utf8.c +245 -0
  86. data/gumbo-parser/src/utf8.h +164 -0
  87. data/gumbo-parser/src/util.c +66 -0
  88. data/gumbo-parser/src/util.h +34 -0
  89. data/gumbo-parser/src/vector.c +111 -0
  90. data/gumbo-parser/src/vector.h +45 -0
  91. data/lib/nokogiri/class_resolver.rb +67 -0
  92. data/lib/nokogiri/css/node.rb +10 -8
  93. data/lib/nokogiri/css/parser.rb +397 -377
  94. data/lib/nokogiri/css/parser.y +250 -245
  95. data/lib/nokogiri/css/parser_extras.rb +54 -49
  96. data/lib/nokogiri/css/syntax_error.rb +3 -1
  97. data/lib/nokogiri/css/tokenizer.rb +107 -104
  98. data/lib/nokogiri/css/tokenizer.rex +3 -2
  99. data/lib/nokogiri/css/xpath_visitor.rb +224 -95
  100. data/lib/nokogiri/css.rb +56 -17
  101. data/lib/nokogiri/decorators/slop.rb +9 -7
  102. data/lib/nokogiri/encoding_handler.rb +57 -0
  103. data/lib/nokogiri/extension.rb +32 -0
  104. data/lib/nokogiri/gumbo.rb +15 -0
  105. data/lib/nokogiri/html.rb +38 -27
  106. data/lib/nokogiri/{html → html4}/builder.rb +4 -2
  107. data/lib/nokogiri/html4/document.rb +214 -0
  108. data/lib/nokogiri/html4/document_fragment.rb +54 -0
  109. data/lib/nokogiri/{html → html4}/element_description.rb +3 -1
  110. data/lib/nokogiri/html4/element_description_defaults.rb +2040 -0
  111. data/lib/nokogiri/html4/encoding_reader.rb +121 -0
  112. data/lib/nokogiri/{html → html4}/entity_lookup.rb +4 -2
  113. data/lib/nokogiri/{html → html4}/sax/parser.rb +17 -16
  114. data/lib/nokogiri/html4/sax/parser_context.rb +20 -0
  115. data/lib/nokogiri/{html → html4}/sax/push_parser.rb +12 -11
  116. data/lib/nokogiri/html4.rb +47 -0
  117. data/lib/nokogiri/html5/document.rb +168 -0
  118. data/lib/nokogiri/html5/document_fragment.rb +90 -0
  119. data/lib/nokogiri/html5/node.rb +103 -0
  120. data/lib/nokogiri/html5.rb +392 -0
  121. data/lib/nokogiri/jruby/dependencies.rb +3 -0
  122. data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
  123. data/lib/nokogiri/syntax_error.rb +2 -0
  124. data/lib/nokogiri/version/constant.rb +6 -0
  125. data/lib/nokogiri/version/info.rb +223 -0
  126. data/lib/nokogiri/version.rb +3 -108
  127. data/lib/nokogiri/xml/attr.rb +55 -3
  128. data/lib/nokogiri/xml/attribute_decl.rb +6 -2
  129. data/lib/nokogiri/xml/builder.rb +98 -54
  130. data/lib/nokogiri/xml/cdata.rb +3 -1
  131. data/lib/nokogiri/xml/character_data.rb +2 -0
  132. data/lib/nokogiri/xml/document.rb +312 -126
  133. data/lib/nokogiri/xml/document_fragment.rb +93 -48
  134. data/lib/nokogiri/xml/dtd.rb +4 -2
  135. data/lib/nokogiri/xml/element_content.rb +12 -2
  136. data/lib/nokogiri/xml/element_decl.rb +6 -2
  137. data/lib/nokogiri/xml/entity_decl.rb +7 -3
  138. data/lib/nokogiri/xml/entity_reference.rb +2 -0
  139. data/lib/nokogiri/xml/namespace.rb +45 -0
  140. data/lib/nokogiri/xml/node/save_options.rb +23 -8
  141. data/lib/nokogiri/xml/node.rb +1088 -418
  142. data/lib/nokogiri/xml/node_set.rb +173 -63
  143. data/lib/nokogiri/xml/notation.rb +13 -0
  144. data/lib/nokogiri/xml/parse_options.rb +145 -52
  145. data/lib/nokogiri/xml/pp/character_data.rb +9 -6
  146. data/lib/nokogiri/xml/pp/node.rb +42 -30
  147. data/lib/nokogiri/xml/pp.rb +4 -2
  148. data/lib/nokogiri/xml/processing_instruction.rb +4 -1
  149. data/lib/nokogiri/xml/reader.rb +21 -28
  150. data/lib/nokogiri/xml/relax_ng.rb +8 -2
  151. data/lib/nokogiri/xml/sax/document.rb +45 -49
  152. data/lib/nokogiri/xml/sax/parser.rb +39 -36
  153. data/lib/nokogiri/xml/sax/parser_context.rb +8 -3
  154. data/lib/nokogiri/xml/sax/push_parser.rb +6 -5
  155. data/lib/nokogiri/xml/sax.rb +6 -4
  156. data/lib/nokogiri/xml/schema.rb +19 -9
  157. data/lib/nokogiri/xml/searchable.rb +120 -72
  158. data/lib/nokogiri/xml/syntax_error.rb +6 -4
  159. data/lib/nokogiri/xml/text.rb +2 -0
  160. data/lib/nokogiri/xml/xpath/syntax_error.rb +4 -2
  161. data/lib/nokogiri/xml/xpath.rb +15 -4
  162. data/lib/nokogiri/xml/xpath_context.rb +3 -3
  163. data/lib/nokogiri/xml.rb +38 -37
  164. data/lib/nokogiri/xslt/stylesheet.rb +3 -1
  165. data/lib/nokogiri/xslt.rb +101 -22
  166. data/lib/nokogiri.rb +59 -75
  167. data/lib/xsd/xmlparser/nokogiri.rb +29 -25
  168. data/patches/libxml2/0001-Remove-script-macro-support.patch +40 -0
  169. data/patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch +44 -0
  170. data/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch +25 -0
  171. data/patches/libxml2/0009-allow-wildcard-namespaces.patch +77 -0
  172. data/patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch +224 -0
  173. data/patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch +30 -0
  174. data/patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch +224 -0
  175. data/ports/archives/libxml2-2.11.4.tar.xz +0 -0
  176. data/ports/archives/libxslt-1.1.38.tar.xz +0 -0
  177. metadata +128 -265
  178. data/ext/nokogiri/html_document.c +0 -170
  179. data/ext/nokogiri/html_document.h +0 -10
  180. data/ext/nokogiri/html_element_description.c +0 -279
  181. data/ext/nokogiri/html_element_description.h +0 -10
  182. data/ext/nokogiri/html_entity_lookup.c +0 -32
  183. data/ext/nokogiri/html_entity_lookup.h +0 -8
  184. data/ext/nokogiri/html_sax_parser_context.c +0 -116
  185. data/ext/nokogiri/html_sax_parser_context.h +0 -11
  186. data/ext/nokogiri/html_sax_push_parser.c +0 -87
  187. data/ext/nokogiri/html_sax_push_parser.h +0 -9
  188. data/ext/nokogiri/xml_attr.h +0 -9
  189. data/ext/nokogiri/xml_attribute_decl.h +0 -9
  190. data/ext/nokogiri/xml_cdata.h +0 -9
  191. data/ext/nokogiri/xml_comment.h +0 -9
  192. data/ext/nokogiri/xml_document.h +0 -23
  193. data/ext/nokogiri/xml_document_fragment.h +0 -10
  194. data/ext/nokogiri/xml_dtd.h +0 -10
  195. data/ext/nokogiri/xml_element_content.h +0 -10
  196. data/ext/nokogiri/xml_element_decl.h +0 -9
  197. data/ext/nokogiri/xml_encoding_handler.h +0 -8
  198. data/ext/nokogiri/xml_entity_decl.h +0 -10
  199. data/ext/nokogiri/xml_entity_reference.h +0 -9
  200. data/ext/nokogiri/xml_io.c +0 -61
  201. data/ext/nokogiri/xml_io.h +0 -11
  202. data/ext/nokogiri/xml_libxml2_hacks.c +0 -112
  203. data/ext/nokogiri/xml_libxml2_hacks.h +0 -12
  204. data/ext/nokogiri/xml_namespace.h +0 -14
  205. data/ext/nokogiri/xml_node.h +0 -13
  206. data/ext/nokogiri/xml_node_set.h +0 -12
  207. data/ext/nokogiri/xml_processing_instruction.h +0 -9
  208. data/ext/nokogiri/xml_reader.h +0 -10
  209. data/ext/nokogiri/xml_relax_ng.h +0 -9
  210. data/ext/nokogiri/xml_sax_parser.h +0 -39
  211. data/ext/nokogiri/xml_sax_parser_context.h +0 -10
  212. data/ext/nokogiri/xml_sax_push_parser.h +0 -9
  213. data/ext/nokogiri/xml_schema.h +0 -9
  214. data/ext/nokogiri/xml_syntax_error.h +0 -13
  215. data/ext/nokogiri/xml_text.h +0 -9
  216. data/ext/nokogiri/xml_xpath_context.h +0 -10
  217. data/ext/nokogiri/xslt_stylesheet.h +0 -14
  218. data/lib/nokogiri/html/document.rb +0 -335
  219. data/lib/nokogiri/html/document_fragment.rb +0 -49
  220. data/lib/nokogiri/html/element_description_defaults.rb +0 -671
  221. data/lib/nokogiri/html/sax/parser_context.rb +0 -16
  222. data/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch +0 -78
  223. data/patches/libxml2/0002-Fix-nullptr-deref-with-XPath-logic-ops.patch +0 -54
  224. data/patches/libxml2/0003-Fix-infinite-loop-in-LZMA-decompression.patch +0 -50
  225. data/ports/archives/libxml2-2.9.8.tar.gz +0 -0
  226. data/ports/archives/libxslt-1.1.32.tar.gz +0 -0
metadata CHANGED
@@ -1,20 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.15.3
5
5
  platform: ruby
6
6
  authors:
7
- - Aaron Patterson
8
7
  - Mike Dalessio
8
+ - Aaron Patterson
9
9
  - Yoko Harada
10
- - Tim Elliott
11
10
  - Akinori MUSHA
12
11
  - John Shahid
12
+ - Karol Bucek
13
+ - Sam Ruby
14
+ - Craig Barnes
15
+ - Stephen Checkoway
13
16
  - Lars Kanis
17
+ - Sergio Arbeo
18
+ - Timothy Elliott
19
+ - Nobuyoshi Nakada
14
20
  autorequire:
15
21
  bindir: bin
16
22
  cert_chain: []
17
- date: 2018-12-18 00:00:00.000000000 Z
23
+ date: 2023-07-05 00:00:00.000000000 Z
18
24
  dependencies:
19
25
  - !ruby/object:Gem::Dependency
20
26
  name: mini_portile2
@@ -22,228 +28,49 @@ dependencies:
22
28
  requirements:
23
29
  - - "~>"
24
30
  - !ruby/object:Gem::Version
25
- version: 2.4.0
31
+ version: 2.8.2
26
32
  type: :runtime
27
33
  prerelease: false
28
34
  version_requirements: !ruby/object:Gem::Requirement
29
35
  requirements:
30
36
  - - "~>"
31
37
  - !ruby/object:Gem::Version
32
- version: 2.4.0
33
- - !ruby/object:Gem::Dependency
34
- name: hoe-bundler
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.2'
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.2'
47
- - !ruby/object:Gem::Dependency
48
- name: hoe-debugging
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '2.0'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '2.0'
61
- - !ruby/object:Gem::Dependency
62
- name: hoe-gemspec
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '1.0'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '1.0'
75
- - !ruby/object:Gem::Dependency
76
- name: hoe-git
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.6'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.6'
89
- - !ruby/object:Gem::Dependency
90
- name: minitest
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: 5.8.4
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: 5.8.4
103
- - !ruby/object:Gem::Dependency
104
- name: rake
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '12.0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '12.0'
117
- - !ruby/object:Gem::Dependency
118
- name: rake-compiler
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: 1.0.3
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: 1.0.3
131
- - !ruby/object:Gem::Dependency
132
- name: rake-compiler-dock
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: 0.6.2
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: 0.6.2
38
+ version: 2.8.2
39
+ force_ruby_platform: false
145
40
  - !ruby/object:Gem::Dependency
146
41
  name: racc
147
42
  requirement: !ruby/object:Gem::Requirement
148
43
  requirements:
149
44
  - - "~>"
150
45
  - !ruby/object:Gem::Version
151
- version: 1.4.14
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: 1.4.14
159
- - !ruby/object:Gem::Dependency
160
- name: rexical
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - "~>"
164
- - !ruby/object:Gem::Version
165
- version: 1.0.5
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - "~>"
171
- - !ruby/object:Gem::Version
172
- version: 1.0.5
173
- - !ruby/object:Gem::Dependency
174
- name: concourse
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - "~>"
178
- - !ruby/object:Gem::Version
179
- version: '0.15'
180
- type: :development
181
- prerelease: false
182
- version_requirements: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - "~>"
185
- - !ruby/object:Gem::Version
186
- version: '0.15'
187
- - !ruby/object:Gem::Dependency
188
- name: rdoc
189
- requirement: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: '4.0'
194
- - - "<"
195
- - !ruby/object:Gem::Version
196
- version: '7'
197
- type: :development
198
- prerelease: false
199
- version_requirements: !ruby/object:Gem::Requirement
200
- requirements:
201
- - - ">="
202
- - !ruby/object:Gem::Version
203
- version: '4.0'
204
- - - "<"
205
- - !ruby/object:Gem::Version
206
- version: '7'
207
- - !ruby/object:Gem::Dependency
208
- name: hoe
209
- requirement: !ruby/object:Gem::Requirement
210
- requirements:
211
- - - "~>"
212
- - !ruby/object:Gem::Version
213
- version: '3.17'
214
- type: :development
46
+ version: '1.4'
47
+ type: :runtime
215
48
  prerelease: false
216
49
  version_requirements: !ruby/object:Gem::Requirement
217
50
  requirements:
218
51
  - - "~>"
219
52
  - !ruby/object:Gem::Version
220
- version: '3.17'
221
- description: |-
222
- Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among
223
- Nokogiri's many features is the ability to search documents via XPath
224
- or CSS3 selectors.
225
- email:
226
- - aaronp@rubyforge.org
227
- - mike.dalessio@gmail.com
228
- - yokolet@gmail.com
229
- - tle@holymonkey.com
230
- - knu@idaemons.org
231
- - jvshahid@gmail.com
232
- - lars@greiz-reinsdorf.de
53
+ version: '1.4'
54
+ force_ruby_platform: false
55
+ description: |
56
+ Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a
57
+ sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is
58
+ fast and standards-compliant by relying on native parsers like libxml2, libgumbo, or xerces.
59
+ email: nokogiri-talk@googlegroups.com
233
60
  executables:
234
61
  - nokogiri
235
62
  extensions:
236
63
  - ext/nokogiri/extconf.rb
237
64
  extra_rdoc_files:
238
- - LICENSE-DEPENDENCIES.md
239
- - LICENSE.md
240
- - README.md
241
- - ext/nokogiri/html_document.c
242
- - ext/nokogiri/html_element_description.c
243
- - ext/nokogiri/html_entity_lookup.c
244
- - ext/nokogiri/html_sax_parser_context.c
245
- - ext/nokogiri/html_sax_push_parser.c
65
+ - ext/nokogiri/gumbo.c
66
+ - ext/nokogiri/html4_document.c
67
+ - ext/nokogiri/html4_element_description.c
68
+ - ext/nokogiri/html4_entity_lookup.c
69
+ - ext/nokogiri/html4_sax_parser_context.c
70
+ - ext/nokogiri/html4_sax_push_parser.c
71
+ - ext/nokogiri/libxml2_backwards_compat.c
246
72
  - ext/nokogiri/nokogiri.c
73
+ - ext/nokogiri/test_global_handlers.c
247
74
  - ext/nokogiri/xml_attr.c
248
75
  - ext/nokogiri/xml_attribute_decl.c
249
76
  - ext/nokogiri/xml_cdata.c
@@ -256,8 +83,6 @@ extra_rdoc_files:
256
83
  - ext/nokogiri/xml_encoding_handler.c
257
84
  - ext/nokogiri/xml_entity_decl.c
258
85
  - ext/nokogiri/xml_entity_reference.c
259
- - ext/nokogiri/xml_io.c
260
- - ext/nokogiri/xml_libxml2_hacks.c
261
86
  - ext/nokogiri/xml_namespace.c
262
87
  - ext/nokogiri/xml_node.c
263
88
  - ext/nokogiri/xml_node_set.c
@@ -272,7 +97,9 @@ extra_rdoc_files:
272
97
  - ext/nokogiri/xml_text.c
273
98
  - ext/nokogiri/xml_xpath_context.c
274
99
  - ext/nokogiri/xslt_stylesheet.c
100
+ - README.md
275
101
  files:
102
+ - Gemfile
276
103
  - LICENSE-DEPENDENCIES.md
277
104
  - LICENSE.md
278
105
  - README.md
@@ -280,75 +107,89 @@ files:
280
107
  - dependencies.yml
281
108
  - ext/nokogiri/depend
282
109
  - ext/nokogiri/extconf.rb
283
- - ext/nokogiri/html_document.c
284
- - ext/nokogiri/html_document.h
285
- - ext/nokogiri/html_element_description.c
286
- - ext/nokogiri/html_element_description.h
287
- - ext/nokogiri/html_entity_lookup.c
288
- - ext/nokogiri/html_entity_lookup.h
289
- - ext/nokogiri/html_sax_parser_context.c
290
- - ext/nokogiri/html_sax_parser_context.h
291
- - ext/nokogiri/html_sax_push_parser.c
292
- - ext/nokogiri/html_sax_push_parser.h
110
+ - ext/nokogiri/gumbo.c
111
+ - ext/nokogiri/html4_document.c
112
+ - ext/nokogiri/html4_element_description.c
113
+ - ext/nokogiri/html4_entity_lookup.c
114
+ - ext/nokogiri/html4_sax_parser_context.c
115
+ - ext/nokogiri/html4_sax_push_parser.c
116
+ - ext/nokogiri/libxml2_backwards_compat.c
293
117
  - ext/nokogiri/nokogiri.c
294
118
  - ext/nokogiri/nokogiri.h
119
+ - ext/nokogiri/test_global_handlers.c
295
120
  - ext/nokogiri/xml_attr.c
296
- - ext/nokogiri/xml_attr.h
297
121
  - ext/nokogiri/xml_attribute_decl.c
298
- - ext/nokogiri/xml_attribute_decl.h
299
122
  - ext/nokogiri/xml_cdata.c
300
- - ext/nokogiri/xml_cdata.h
301
123
  - ext/nokogiri/xml_comment.c
302
- - ext/nokogiri/xml_comment.h
303
124
  - ext/nokogiri/xml_document.c
304
- - ext/nokogiri/xml_document.h
305
125
  - ext/nokogiri/xml_document_fragment.c
306
- - ext/nokogiri/xml_document_fragment.h
307
126
  - ext/nokogiri/xml_dtd.c
308
- - ext/nokogiri/xml_dtd.h
309
127
  - ext/nokogiri/xml_element_content.c
310
- - ext/nokogiri/xml_element_content.h
311
128
  - ext/nokogiri/xml_element_decl.c
312
- - ext/nokogiri/xml_element_decl.h
313
129
  - ext/nokogiri/xml_encoding_handler.c
314
- - ext/nokogiri/xml_encoding_handler.h
315
130
  - ext/nokogiri/xml_entity_decl.c
316
- - ext/nokogiri/xml_entity_decl.h
317
131
  - ext/nokogiri/xml_entity_reference.c
318
- - ext/nokogiri/xml_entity_reference.h
319
- - ext/nokogiri/xml_io.c
320
- - ext/nokogiri/xml_io.h
321
- - ext/nokogiri/xml_libxml2_hacks.c
322
- - ext/nokogiri/xml_libxml2_hacks.h
323
132
  - ext/nokogiri/xml_namespace.c
324
- - ext/nokogiri/xml_namespace.h
325
133
  - ext/nokogiri/xml_node.c
326
- - ext/nokogiri/xml_node.h
327
134
  - ext/nokogiri/xml_node_set.c
328
- - ext/nokogiri/xml_node_set.h
329
135
  - ext/nokogiri/xml_processing_instruction.c
330
- - ext/nokogiri/xml_processing_instruction.h
331
136
  - ext/nokogiri/xml_reader.c
332
- - ext/nokogiri/xml_reader.h
333
137
  - ext/nokogiri/xml_relax_ng.c
334
- - ext/nokogiri/xml_relax_ng.h
335
138
  - ext/nokogiri/xml_sax_parser.c
336
- - ext/nokogiri/xml_sax_parser.h
337
139
  - ext/nokogiri/xml_sax_parser_context.c
338
- - ext/nokogiri/xml_sax_parser_context.h
339
140
  - ext/nokogiri/xml_sax_push_parser.c
340
- - ext/nokogiri/xml_sax_push_parser.h
341
141
  - ext/nokogiri/xml_schema.c
342
- - ext/nokogiri/xml_schema.h
343
142
  - ext/nokogiri/xml_syntax_error.c
344
- - ext/nokogiri/xml_syntax_error.h
345
143
  - ext/nokogiri/xml_text.c
346
- - ext/nokogiri/xml_text.h
347
144
  - ext/nokogiri/xml_xpath_context.c
348
- - ext/nokogiri/xml_xpath_context.h
349
145
  - ext/nokogiri/xslt_stylesheet.c
350
- - ext/nokogiri/xslt_stylesheet.h
146
+ - gumbo-parser/CHANGES.md
147
+ - gumbo-parser/Makefile
148
+ - gumbo-parser/THANKS
149
+ - gumbo-parser/src/Makefile
150
+ - gumbo-parser/src/README.md
151
+ - gumbo-parser/src/ascii.c
152
+ - gumbo-parser/src/ascii.h
153
+ - gumbo-parser/src/attribute.c
154
+ - gumbo-parser/src/attribute.h
155
+ - gumbo-parser/src/char_ref.c
156
+ - gumbo-parser/src/char_ref.h
157
+ - gumbo-parser/src/char_ref.rl
158
+ - gumbo-parser/src/error.c
159
+ - gumbo-parser/src/error.h
160
+ - gumbo-parser/src/foreign_attrs.c
161
+ - gumbo-parser/src/foreign_attrs.gperf
162
+ - gumbo-parser/src/insertion_mode.h
163
+ - gumbo-parser/src/macros.h
164
+ - gumbo-parser/src/nokogiri_gumbo.h
165
+ - gumbo-parser/src/parser.c
166
+ - gumbo-parser/src/parser.h
167
+ - gumbo-parser/src/replacement.h
168
+ - gumbo-parser/src/string_buffer.c
169
+ - gumbo-parser/src/string_buffer.h
170
+ - gumbo-parser/src/string_piece.c
171
+ - gumbo-parser/src/svg_attrs.c
172
+ - gumbo-parser/src/svg_attrs.gperf
173
+ - gumbo-parser/src/svg_tags.c
174
+ - gumbo-parser/src/svg_tags.gperf
175
+ - gumbo-parser/src/tag.c
176
+ - gumbo-parser/src/tag_lookup.c
177
+ - gumbo-parser/src/tag_lookup.gperf
178
+ - gumbo-parser/src/tag_lookup.h
179
+ - gumbo-parser/src/token_buffer.c
180
+ - gumbo-parser/src/token_buffer.h
181
+ - gumbo-parser/src/token_type.h
182
+ - gumbo-parser/src/tokenizer.c
183
+ - gumbo-parser/src/tokenizer.h
184
+ - gumbo-parser/src/tokenizer_states.h
185
+ - gumbo-parser/src/utf8.c
186
+ - gumbo-parser/src/utf8.h
187
+ - gumbo-parser/src/util.c
188
+ - gumbo-parser/src/util.h
189
+ - gumbo-parser/src/vector.c
190
+ - gumbo-parser/src/vector.h
351
191
  - lib/nokogiri.rb
192
+ - lib/nokogiri/class_resolver.rb
352
193
  - lib/nokogiri/css.rb
353
194
  - lib/nokogiri/css/node.rb
354
195
  - lib/nokogiri/css/parser.rb
@@ -359,18 +200,31 @@ files:
359
200
  - lib/nokogiri/css/tokenizer.rex
360
201
  - lib/nokogiri/css/xpath_visitor.rb
361
202
  - lib/nokogiri/decorators/slop.rb
203
+ - lib/nokogiri/encoding_handler.rb
204
+ - lib/nokogiri/extension.rb
205
+ - lib/nokogiri/gumbo.rb
362
206
  - lib/nokogiri/html.rb
363
- - lib/nokogiri/html/builder.rb
364
- - lib/nokogiri/html/document.rb
365
- - lib/nokogiri/html/document_fragment.rb
366
- - lib/nokogiri/html/element_description.rb
367
- - lib/nokogiri/html/element_description_defaults.rb
368
- - lib/nokogiri/html/entity_lookup.rb
369
- - lib/nokogiri/html/sax/parser.rb
370
- - lib/nokogiri/html/sax/parser_context.rb
371
- - lib/nokogiri/html/sax/push_parser.rb
207
+ - lib/nokogiri/html4.rb
208
+ - lib/nokogiri/html4/builder.rb
209
+ - lib/nokogiri/html4/document.rb
210
+ - lib/nokogiri/html4/document_fragment.rb
211
+ - lib/nokogiri/html4/element_description.rb
212
+ - lib/nokogiri/html4/element_description_defaults.rb
213
+ - lib/nokogiri/html4/encoding_reader.rb
214
+ - lib/nokogiri/html4/entity_lookup.rb
215
+ - lib/nokogiri/html4/sax/parser.rb
216
+ - lib/nokogiri/html4/sax/parser_context.rb
217
+ - lib/nokogiri/html4/sax/push_parser.rb
218
+ - lib/nokogiri/html5.rb
219
+ - lib/nokogiri/html5/document.rb
220
+ - lib/nokogiri/html5/document_fragment.rb
221
+ - lib/nokogiri/html5/node.rb
222
+ - lib/nokogiri/jruby/dependencies.rb
223
+ - lib/nokogiri/jruby/nokogiri_jars.rb
372
224
  - lib/nokogiri/syntax_error.rb
373
225
  - lib/nokogiri/version.rb
226
+ - lib/nokogiri/version/constant.rb
227
+ - lib/nokogiri/version/info.rb
374
228
  - lib/nokogiri/xml.rb
375
229
  - lib/nokogiri/xml/attr.rb
376
230
  - lib/nokogiri/xml/attribute_decl.rb
@@ -411,15 +265,25 @@ files:
411
265
  - lib/nokogiri/xslt.rb
412
266
  - lib/nokogiri/xslt/stylesheet.rb
413
267
  - lib/xsd/xmlparser/nokogiri.rb
414
- - patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
415
- - patches/libxml2/0002-Fix-nullptr-deref-with-XPath-logic-ops.patch
416
- - patches/libxml2/0003-Fix-infinite-loop-in-LZMA-decompression.patch
417
- - ports/archives/libxml2-2.9.8.tar.gz
418
- - ports/archives/libxslt-1.1.32.tar.gz
419
- homepage:
268
+ - patches/libxml2/0001-Remove-script-macro-support.patch
269
+ - patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
270
+ - patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
271
+ - patches/libxml2/0009-allow-wildcard-namespaces.patch
272
+ - patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch
273
+ - patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch
274
+ - patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch
275
+ - ports/archives/libxml2-2.11.4.tar.xz
276
+ - ports/archives/libxslt-1.1.38.tar.xz
277
+ homepage: https://nokogiri.org
420
278
  licenses:
421
279
  - MIT
422
- metadata: {}
280
+ metadata:
281
+ homepage_uri: https://nokogiri.org
282
+ bug_tracker_uri: https://github.com/sparklemotion/nokogiri/issues
283
+ documentation_uri: https://nokogiri.org/rdoc/index.html
284
+ changelog_uri: https://nokogiri.org/CHANGELOG.html
285
+ source_code_uri: https://github.com/sparklemotion/nokogiri
286
+ rubygems_mfa_required: 'true'
423
287
  post_install_message:
424
288
  rdoc_options:
425
289
  - "--main"
@@ -430,16 +294,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
430
294
  requirements:
431
295
  - - ">="
432
296
  - !ruby/object:Gem::Version
433
- version: 2.1.0
297
+ version: 2.7.0
434
298
  required_rubygems_version: !ruby/object:Gem::Requirement
435
299
  requirements:
436
300
  - - ">="
437
301
  - !ruby/object:Gem::Version
438
302
  version: '0'
439
303
  requirements: []
440
- rubyforge_project:
441
- rubygems_version: 2.7.8
304
+ rubygems_version: 3.4.10
442
305
  signing_key:
443
306
  specification_version: 4
444
- summary: Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser
307
+ summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
445
308
  test_files: []
@@ -1,170 +0,0 @@
1
- #include <html_document.h>
2
-
3
- static ID id_encoding_found;
4
-
5
- /*
6
- * call-seq:
7
- * new
8
- *
9
- * Create a new document
10
- */
11
- static VALUE new(int argc, VALUE *argv, VALUE klass)
12
- {
13
- VALUE uri, external_id, rest, rb_doc;
14
- htmlDocPtr doc;
15
-
16
- rb_scan_args(argc, argv, "0*", &rest);
17
- uri = rb_ary_entry(rest, (long)0);
18
- external_id = rb_ary_entry(rest, (long)1);
19
-
20
- doc = htmlNewDoc(
21
- RTEST(uri) ? (const xmlChar *)StringValueCStr(uri) : NULL,
22
- RTEST(external_id) ? (const xmlChar *)StringValueCStr(external_id) : NULL
23
- );
24
- rb_doc = Nokogiri_wrap_xml_document(klass, doc);
25
- rb_obj_call_init(rb_doc, argc, argv);
26
- return rb_doc ;
27
- }
28
-
29
- /*
30
- * call-seq:
31
- * read_io(io, url, encoding, options)
32
- *
33
- * Read the HTML document from +io+ with given +url+, +encoding+,
34
- * and +options+. See Nokogiri::HTML.parse
35
- */
36
- static VALUE read_io( VALUE klass,
37
- VALUE io,
38
- VALUE url,
39
- VALUE encoding,
40
- VALUE options )
41
- {
42
- const char * c_url = NIL_P(url) ? NULL : StringValueCStr(url);
43
- const char * c_enc = NIL_P(encoding) ? NULL : StringValueCStr(encoding);
44
- VALUE error_list = rb_ary_new();
45
- VALUE document;
46
- htmlDocPtr doc;
47
-
48
- xmlResetLastError();
49
- xmlSetStructuredErrorFunc((void *)error_list, Nokogiri_error_array_pusher);
50
-
51
- doc = htmlReadIO(
52
- io_read_callback,
53
- io_close_callback,
54
- (void *)io,
55
- c_url,
56
- c_enc,
57
- (int)NUM2INT(options)
58
- );
59
- xmlSetStructuredErrorFunc(NULL, NULL);
60
-
61
- /*
62
- * If EncodingFound has occurred in EncodingReader, make sure to do
63
- * a cleanup and propagate the error.
64
- */
65
- if (rb_respond_to(io, id_encoding_found)) {
66
- VALUE encoding_found = rb_funcall(io, id_encoding_found, 0);
67
- if (!NIL_P(encoding_found)) {
68
- xmlFreeDoc(doc);
69
- rb_exc_raise(encoding_found);
70
- }
71
- }
72
-
73
- if(doc == NULL) {
74
- xmlErrorPtr error;
75
-
76
- xmlFreeDoc(doc);
77
-
78
- error = xmlGetLastError();
79
- if(error)
80
- rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error));
81
- else
82
- rb_raise(rb_eRuntimeError, "Could not parse document");
83
-
84
- return Qnil;
85
- }
86
-
87
- document = Nokogiri_wrap_xml_document(klass, doc);
88
- rb_iv_set(document, "@errors", error_list);
89
- return document;
90
- }
91
-
92
- /*
93
- * call-seq:
94
- * read_memory(string, url, encoding, options)
95
- *
96
- * Read the HTML document contained in +string+ with given +url+, +encoding+,
97
- * and +options+. See Nokogiri::HTML.parse
98
- */
99
- static VALUE read_memory( VALUE klass,
100
- VALUE string,
101
- VALUE url,
102
- VALUE encoding,
103
- VALUE options )
104
- {
105
- const char * c_buffer = StringValuePtr(string);
106
- const char * c_url = NIL_P(url) ? NULL : StringValueCStr(url);
107
- const char * c_enc = NIL_P(encoding) ? NULL : StringValueCStr(encoding);
108
- int len = (int)RSTRING_LEN(string);
109
- VALUE error_list = rb_ary_new();
110
- VALUE document;
111
- htmlDocPtr doc;
112
-
113
- xmlResetLastError();
114
- xmlSetStructuredErrorFunc((void *)error_list, Nokogiri_error_array_pusher);
115
-
116
- doc = htmlReadMemory(c_buffer, len, c_url, c_enc, (int)NUM2INT(options));
117
- xmlSetStructuredErrorFunc(NULL, NULL);
118
-
119
- if(doc == NULL) {
120
- xmlErrorPtr error;
121
-
122
- xmlFreeDoc(doc);
123
-
124
- error = xmlGetLastError();
125
- if(error)
126
- rb_exc_raise(Nokogiri_wrap_xml_syntax_error(error));
127
- else
128
- rb_raise(rb_eRuntimeError, "Could not parse document");
129
-
130
- return Qnil;
131
- }
132
-
133
- document = Nokogiri_wrap_xml_document(klass, doc);
134
- rb_iv_set(document, "@errors", error_list);
135
- return document;
136
- }
137
-
138
- /*
139
- * call-seq:
140
- * type
141
- *
142
- * The type for this document
143
- */
144
- static VALUE type(VALUE self)
145
- {
146
- htmlDocPtr doc;
147
- Data_Get_Struct(self, xmlDoc, doc);
148
- return INT2NUM((long)doc->type);
149
- }
150
-
151
- VALUE cNokogiriHtmlDocument ;
152
- void init_html_document()
153
- {
154
- VALUE nokogiri = rb_define_module("Nokogiri");
155
- VALUE html = rb_define_module_under(nokogiri, "HTML");
156
- VALUE xml = rb_define_module_under(nokogiri, "XML");
157
- VALUE node = rb_define_class_under(xml, "Node", rb_cObject);
158
- VALUE xml_doc = rb_define_class_under(xml, "Document", node);
159
- VALUE klass = rb_define_class_under(html, "Document", xml_doc);
160
-
161
- cNokogiriHtmlDocument = klass;
162
-
163
- rb_define_singleton_method(klass, "read_memory", read_memory, 4);
164
- rb_define_singleton_method(klass, "read_io", read_io, 4);
165
- rb_define_singleton_method(klass, "new", new, -1);
166
-
167
- rb_define_method(klass, "type", type, 0);
168
-
169
- id_encoding_found = rb_intern("encoding_found");
170
- }
@@ -1,10 +0,0 @@
1
- #ifndef NOKOGIRI_HTML_DOCUMENT
2
- #define NOKOGIRI_HTML_DOCUMENT
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_html_document();
7
-
8
- extern VALUE cNokogiriHtmlDocument ;
9
-
10
- #endif