nokogiri 1.11.7-java → 1.12.0-java
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.
- checksums.yaml +4 -4
- data/LICENSE-DEPENDENCIES.md +243 -22
- data/LICENSE.md +1 -1
- data/README.md +6 -5
- data/ext/java/nokogiri/{HtmlDocument.java → Html4Document.java} +8 -22
- data/ext/java/nokogiri/{HtmlElementDescription.java → Html4ElementDescription.java} +6 -6
- data/ext/java/nokogiri/{HtmlEntityLookup.java → Html4EntityLookup.java} +5 -5
- data/ext/java/nokogiri/{HtmlSaxParserContext.java → Html4SaxParserContext.java} +13 -13
- data/ext/java/nokogiri/{HtmlSaxPushParser.java → Html4SaxPushParser.java} +14 -14
- data/ext/java/nokogiri/NokogiriService.java +20 -20
- data/ext/java/nokogiri/XmlAttr.java +2 -2
- data/ext/java/nokogiri/XmlDocument.java +14 -14
- data/ext/java/nokogiri/XmlElementContent.java +5 -5
- data/ext/java/nokogiri/XmlNode.java +74 -74
- data/ext/java/nokogiri/XmlSaxPushParser.java +2 -2
- data/ext/java/nokogiri/XmlSyntaxError.java +1 -1
- data/ext/java/nokogiri/XmlXpathContext.java +9 -9
- data/ext/java/nokogiri/XsltStylesheet.java +8 -8
- data/ext/java/nokogiri/internals/HtmlDomParserContext.java +4 -4
- data/ext/java/nokogiri/internals/NokogiriHandler.java +1 -1
- data/ext/java/nokogiri/internals/NokogiriHelpers.java +57 -57
- data/ext/java/nokogiri/internals/SaveContextVisitor.java +24 -24
- data/ext/java/nokogiri/internals/c14n/CanonicalizerBase.java +105 -105
- data/ext/java/nokogiri/internals/c14n/XMLUtils.java +30 -30
- data/ext/java/nokogiri/internals/dom2dtm/DOM2DTM.java +87 -87
- data/ext/java/nokogiri/internals/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java +95 -95
- data/ext/nokogiri/depend +35 -34
- data/ext/nokogiri/extconf.rb +181 -103
- data/ext/nokogiri/gumbo.c +584 -0
- data/ext/nokogiri/{html_document.c → html4_document.c} +8 -8
- data/ext/nokogiri/{html_element_description.c → html4_element_description.c} +20 -18
- data/ext/nokogiri/{html_entity_lookup.c → html4_entity_lookup.c} +7 -7
- data/ext/nokogiri/{html_sax_parser_context.c → html4_sax_parser_context.c} +5 -5
- data/ext/nokogiri/{html_sax_push_parser.c → html4_sax_push_parser.c} +4 -4
- data/ext/nokogiri/libxml2_backwards_compat.c +30 -30
- data/ext/nokogiri/nokogiri.c +51 -38
- data/ext/nokogiri/xml_document.c +13 -13
- data/ext/nokogiri/xml_element_content.c +2 -0
- data/ext/nokogiri/xml_encoding_handler.c +11 -6
- data/ext/nokogiri/xml_namespace.c +2 -0
- data/ext/nokogiri/xml_node.c +102 -102
- data/ext/nokogiri/xml_node_set.c +20 -20
- data/ext/nokogiri/xml_reader.c +2 -0
- data/ext/nokogiri/xml_sax_parser.c +6 -6
- data/ext/nokogiri/xml_sax_parser_context.c +2 -0
- data/ext/nokogiri/xml_schema.c +2 -0
- data/ext/nokogiri/xml_xpath_context.c +67 -65
- data/ext/nokogiri/xslt_stylesheet.c +2 -1
- data/gumbo-parser/CHANGES.md +63 -0
- data/gumbo-parser/Makefile +101 -0
- data/gumbo-parser/THANKS +27 -0
- data/lib/nokogiri.rb +31 -29
- data/lib/nokogiri/css.rb +14 -14
- data/lib/nokogiri/css/parser.rb +1 -1
- data/lib/nokogiri/css/parser.y +1 -1
- data/lib/nokogiri/css/syntax_error.rb +1 -1
- data/lib/nokogiri/extension.rb +2 -2
- data/lib/nokogiri/gumbo.rb +14 -0
- data/lib/nokogiri/html.rb +31 -27
- data/lib/nokogiri/html4.rb +40 -0
- data/lib/nokogiri/{html → html4}/builder.rb +2 -2
- data/lib/nokogiri/{html → html4}/document.rb +4 -4
- data/lib/nokogiri/{html → html4}/document_fragment.rb +3 -3
- data/lib/nokogiri/{html → html4}/element_description.rb +1 -1
- data/lib/nokogiri/{html → html4}/element_description_defaults.rb +1 -1
- data/lib/nokogiri/{html → html4}/entity_lookup.rb +1 -1
- data/lib/nokogiri/{html → html4}/sax/parser.rb +11 -14
- data/lib/nokogiri/html4/sax/parser_context.rb +19 -0
- data/lib/nokogiri/{html → html4}/sax/push_parser.rb +5 -5
- data/lib/nokogiri/html5.rb +473 -0
- data/lib/nokogiri/html5/document.rb +74 -0
- data/lib/nokogiri/html5/document_fragment.rb +80 -0
- data/lib/nokogiri/html5/node.rb +93 -0
- data/lib/nokogiri/nokogiri.jar +0 -0
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/version/info.rb +11 -2
- data/lib/nokogiri/xml.rb +35 -36
- data/lib/nokogiri/xml/node.rb +6 -5
- data/lib/nokogiri/xml/parse_options.rb +2 -0
- data/lib/nokogiri/xml/pp.rb +2 -2
- data/lib/nokogiri/xml/sax.rb +4 -4
- data/lib/nokogiri/xml/sax/document.rb +24 -30
- data/lib/nokogiri/xml/xpath.rb +2 -2
- data/lib/nokogiri/xslt.rb +16 -16
- data/lib/nokogiri/xslt/stylesheet.rb +1 -1
- metadata +40 -40
- data/lib/nokogiri/html/sax/parser_context.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdd7f8e1abaa3246ca0e41df09b10dd18a3f6f0be1f5cfda6ecaaf70c9ba906c
|
4
|
+
data.tar.gz: ace25ad26fff0fffd0426e7ac3b89159d3e3d815e7e06926031b047be0ec5882
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b3821705254748bfc5fc49b715c963bd2da9cd5c36a080e3ab2c28fb5b917303311cf930efb2cb9016a3026f15d4f8a56f4f09d3a7281fe1aaebeb3d706c4a3
|
7
|
+
data.tar.gz: '039750b07d227c3df2676d568ec50fa5f15affe6148ee3e00bad17c6ac7555811f247c74dcb22fa2241616be1c9ad2cd8e5ce3cfb0c6e7b449359ce198f1d448'
|
data/LICENSE-DEPENDENCIES.md
CHANGED
@@ -4,81 +4,91 @@ Nokogiri ships with some third party dependencies, which are listed here along w
|
|
4
4
|
|
5
5
|
Note that this document is broken into multiple sections, each of which describes the dependencies of a different "platform release" of Nokogiri.
|
6
6
|
|
7
|
+
<!-- regenerate TOC with `markdown-toc -i` -->
|
8
|
+
|
7
9
|
<!-- toc -->
|
8
10
|
|
9
|
-
- [
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
- [Platform Releases](#platform-releases)
|
12
|
+
* [Default platform release ("ruby")](#default-platform-release-ruby)
|
13
|
+
* [Native LinuxⓇ platform releases ("x86_64-linux" and "arm64-linux")](#native-linux%E2%93%A1-platform-releases-x86_64-linux-and-arm64-linux)
|
14
|
+
* [Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin")](#native-darwin-macos%E2%93%A1-platform-releases-x86_64-darwin-and-arm64-darwin)
|
15
|
+
* [Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32")](#native-windows%E2%93%A1-platform-releases-x86-mingw32-and-x64-mingw32)
|
16
|
+
* [JavaⓇ (JRuby) platform release ("java")](#java%E2%93%A1-jruby-platform-release-java)
|
14
17
|
- [Appendix: Dependencies' License Texts](#appendix-dependencies-license-texts)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
* [libgumbo and nokogumbo](#libgumbo-and-nokogumbo)
|
19
|
+
* [libxml2](#libxml2)
|
20
|
+
* [libxslt](#libxslt)
|
21
|
+
* [zlib](#zlib)
|
22
|
+
* [libiconv](#libiconv)
|
23
|
+
* [isorelax](#isorelax)
|
24
|
+
* [jing](#jing)
|
25
|
+
* [nekodtd](#nekodtd)
|
26
|
+
* [nekohtml](#nekohtml)
|
27
|
+
* [xalan](#xalan)
|
28
|
+
* [xerces](#xerces)
|
29
|
+
* [xml-apis](#xml-apis)
|
26
30
|
|
27
31
|
<!-- tocstop -->
|
28
32
|
|
29
|
-
|
33
|
+
Anyone consuming this file via license-tracking software should endeavor to understand which gem file you're downloading and using, so as not to misinterpret the contents of this file and the licenses of the software being distributed.
|
30
34
|
|
31
35
|
You can double-check the dependencies in your gem file by examining the output of `nokogiri -v` after installation, which will emit the complete set of libraries in use (for versions `>= 1.11.0.rc4`).
|
32
36
|
|
33
37
|
In particular, I'm sure somebody's lawyer, somewhere, is going to freak out that the LGPL appears in this file; and so I'd like to take special note that the dependency covered by LGPL, `libiconv`, is only being redistributed in the native Windows and native Darwin platform releases. It's not present in default, JavaⓇ, or native LinuxⓇ releases.
|
34
38
|
|
35
39
|
|
36
|
-
##
|
40
|
+
## Platform Releases
|
41
|
+
|
42
|
+
### Default platform release ("ruby")
|
37
43
|
|
38
44
|
The default platform release distributes the following dependencies in source form:
|
39
45
|
|
40
46
|
- [libxml2](#libxml2)
|
41
47
|
- [libxslt](#libxslt)
|
48
|
+
- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo)
|
42
49
|
|
43
50
|
This distribution can be identified by inspecting the included Gem::Specification, which will have the value "ruby" for its "platform" attribute.
|
44
51
|
|
45
52
|
|
46
|
-
|
53
|
+
### Native LinuxⓇ platform releases ("x86_64-linux" and "arm64-linux")
|
47
54
|
|
48
55
|
The native LinuxⓇ platform release distributes the following dependencies in source form:
|
49
56
|
|
50
57
|
- [libxml2](#libxml2)
|
51
58
|
- [libxslt](#libxslt)
|
59
|
+
- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo)
|
52
60
|
- [zlib](#zlib)
|
53
61
|
|
54
62
|
This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-linux" or "x86-linux" for its "platform.cpu" attribute.
|
55
63
|
|
56
64
|
|
57
|
-
|
65
|
+
### Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin")
|
58
66
|
|
59
67
|
The native Darwin platform release distributes the following dependencies in source form:
|
60
68
|
|
61
69
|
- [libxml2](#libxml2)
|
62
70
|
- [libxslt](#libxslt)
|
71
|
+
- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo)
|
63
72
|
- [zlib](#zlib)
|
64
73
|
- [libiconv](#libiconv)
|
65
74
|
|
66
75
|
This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-darwin" or "arm64-darwin" for its "platform.cpu" attribute. Darwin is also known more familiarly as "OSX" or "macOSⓇ" and is the operating system for many AppleⓇ computers.
|
67
76
|
|
68
77
|
|
69
|
-
|
78
|
+
### Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32")
|
70
79
|
|
71
80
|
The native WindowsⓇ platform release distributes the following dependencies in source form:
|
72
81
|
|
73
82
|
- [libxml2](#libxml2)
|
74
83
|
- [libxslt](#libxslt)
|
84
|
+
- [libgumbo and nokogumbo](#libgumbo-and-nokogumbo)
|
75
85
|
- [zlib](#zlib)
|
76
86
|
- [libiconv](#libiconv)
|
77
87
|
|
78
88
|
This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x64-mingw32" or "x86-mingw32" for its "platform.cpu" attribute.
|
79
89
|
|
80
90
|
|
81
|
-
|
91
|
+
### JavaⓇ (JRuby) platform release ("java")
|
82
92
|
|
83
93
|
The Java platform release distributes the following dependencies as compiled jar files:
|
84
94
|
|
@@ -99,6 +109,217 @@ This section contains a subsection for each potentially-distributed dependency,
|
|
99
109
|
|
100
110
|
Please see previous sections to understand which of these potential dependencies is actually distributed in the gem file you're downloading and using.
|
101
111
|
|
112
|
+
|
113
|
+
### libgumbo and nokogumbo
|
114
|
+
|
115
|
+
Apache 2.0
|
116
|
+
|
117
|
+
https://github.com/rubys/nokogumbo/blob/f6a7412/LICENSE.txt
|
118
|
+
|
119
|
+
|
120
|
+
Apache License
|
121
|
+
Version 2.0, January 2004
|
122
|
+
http://www.apache.org/licenses/
|
123
|
+
|
124
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
125
|
+
|
126
|
+
1. Definitions.
|
127
|
+
|
128
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
129
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
130
|
+
|
131
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
132
|
+
the copyright owner that is granting the License.
|
133
|
+
|
134
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
135
|
+
other entities that control, are controlled by, or are under common
|
136
|
+
control with that entity. For the purposes of this definition,
|
137
|
+
"control" means (i) the power, direct or indirect, to cause the
|
138
|
+
direction or management of such entity, whether by contract or
|
139
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
140
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
141
|
+
|
142
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
143
|
+
exercising permissions granted by this License.
|
144
|
+
|
145
|
+
"Source" form shall mean the preferred form for making modifications,
|
146
|
+
including but not limited to software source code, documentation
|
147
|
+
source, and configuration files.
|
148
|
+
|
149
|
+
"Object" form shall mean any form resulting from mechanical
|
150
|
+
transformation or translation of a Source form, including but
|
151
|
+
not limited to compiled object code, generated documentation,
|
152
|
+
and conversions to other media types.
|
153
|
+
|
154
|
+
"Work" shall mean the work of authorship, whether in Source or
|
155
|
+
Object form, made available under the License, as indicated by a
|
156
|
+
copyright notice that is included in or attached to the work
|
157
|
+
(an example is provided in the Appendix below).
|
158
|
+
|
159
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
160
|
+
form, that is based on (or derived from) the Work and for which the
|
161
|
+
editorial revisions, annotations, elaborations, or other modifications
|
162
|
+
represent, as a whole, an original work of authorship. For the purposes
|
163
|
+
of this License, Derivative Works shall not include works that remain
|
164
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
165
|
+
the Work and Derivative Works thereof.
|
166
|
+
|
167
|
+
"Contribution" shall mean any work of authorship, including
|
168
|
+
the original version of the Work and any modifications or additions
|
169
|
+
to that Work or Derivative Works thereof, that is intentionally
|
170
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
171
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
172
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
173
|
+
means any form of electronic, verbal, or written communication sent
|
174
|
+
to the Licensor or its representatives, including but not limited to
|
175
|
+
communication on electronic mailing lists, source code control systems,
|
176
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
177
|
+
Licensor for the purpose of discussing and improving the Work, but
|
178
|
+
excluding communication that is conspicuously marked or otherwise
|
179
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
180
|
+
|
181
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
182
|
+
on behalf of whom a Contribution has been received by Licensor and
|
183
|
+
subsequently incorporated within the Work.
|
184
|
+
|
185
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
186
|
+
this License, each Contributor hereby grants to You a perpetual,
|
187
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
188
|
+
copyright license to reproduce, prepare Derivative Works of,
|
189
|
+
publicly display, publicly perform, sublicense, and distribute the
|
190
|
+
Work and such Derivative Works in Source or Object form.
|
191
|
+
|
192
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
193
|
+
this License, each Contributor hereby grants to You a perpetual,
|
194
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
195
|
+
(except as stated in this section) patent license to make, have made,
|
196
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
197
|
+
where such license applies only to those patent claims licensable
|
198
|
+
by such Contributor that are necessarily infringed by their
|
199
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
200
|
+
with the Work to which such Contribution(s) was submitted. If You
|
201
|
+
institute patent litigation against any entity (including a
|
202
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
203
|
+
or a Contribution incorporated within the Work constitutes direct
|
204
|
+
or contributory patent infringement, then any patent licenses
|
205
|
+
granted to You under this License for that Work shall terminate
|
206
|
+
as of the date such litigation is filed.
|
207
|
+
|
208
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
209
|
+
Work or Derivative Works thereof in any medium, with or without
|
210
|
+
modifications, and in Source or Object form, provided that You
|
211
|
+
meet the following conditions:
|
212
|
+
|
213
|
+
(a) You must give any other recipients of the Work or
|
214
|
+
Derivative Works a copy of this License; and
|
215
|
+
|
216
|
+
(b) You must cause any modified files to carry prominent notices
|
217
|
+
stating that You changed the files; and
|
218
|
+
|
219
|
+
(c) You must retain, in the Source form of any Derivative Works
|
220
|
+
that You distribute, all copyright, patent, trademark, and
|
221
|
+
attribution notices from the Source form of the Work,
|
222
|
+
excluding those notices that do not pertain to any part of
|
223
|
+
the Derivative Works; and
|
224
|
+
|
225
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
226
|
+
distribution, then any Derivative Works that You distribute must
|
227
|
+
include a readable copy of the attribution notices contained
|
228
|
+
within such NOTICE file, excluding those notices that do not
|
229
|
+
pertain to any part of the Derivative Works, in at least one
|
230
|
+
of the following places: within a NOTICE text file distributed
|
231
|
+
as part of the Derivative Works; within the Source form or
|
232
|
+
documentation, if provided along with the Derivative Works; or,
|
233
|
+
within a display generated by the Derivative Works, if and
|
234
|
+
wherever such third-party notices normally appear. The contents
|
235
|
+
of the NOTICE file are for informational purposes only and
|
236
|
+
do not modify the License. You may add Your own attribution
|
237
|
+
notices within Derivative Works that You distribute, alongside
|
238
|
+
or as an addendum to the NOTICE text from the Work, provided
|
239
|
+
that such additional attribution notices cannot be construed
|
240
|
+
as modifying the License.
|
241
|
+
|
242
|
+
You may add Your own copyright statement to Your modifications and
|
243
|
+
may provide additional or different license terms and conditions
|
244
|
+
for use, reproduction, or distribution of Your modifications, or
|
245
|
+
for any such Derivative Works as a whole, provided Your use,
|
246
|
+
reproduction, and distribution of the Work otherwise complies with
|
247
|
+
the conditions stated in this License.
|
248
|
+
|
249
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
250
|
+
any Contribution intentionally submitted for inclusion in the Work
|
251
|
+
by You to the Licensor shall be under the terms and conditions of
|
252
|
+
this License, without any additional terms or conditions.
|
253
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
254
|
+
the terms of any separate license agreement you may have executed
|
255
|
+
with Licensor regarding such Contributions.
|
256
|
+
|
257
|
+
6. Trademarks. This License does not grant permission to use the trade
|
258
|
+
names, trademarks, service marks, or product names of the Licensor,
|
259
|
+
except as required for reasonable and customary use in describing the
|
260
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
261
|
+
|
262
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
263
|
+
agreed to in writing, Licensor provides the Work (and each
|
264
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
265
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
266
|
+
implied, including, without limitation, any warranties or conditions
|
267
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
268
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
269
|
+
appropriateness of using or redistributing the Work and assume any
|
270
|
+
risks associated with Your exercise of permissions under this License.
|
271
|
+
|
272
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
273
|
+
whether in tort (including negligence), contract, or otherwise,
|
274
|
+
unless required by applicable law (such as deliberate and grossly
|
275
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
276
|
+
liable to You for damages, including any direct, indirect, special,
|
277
|
+
incidental, or consequential damages of any character arising as a
|
278
|
+
result of this License or out of the use or inability to use the
|
279
|
+
Work (including but not limited to damages for loss of goodwill,
|
280
|
+
work stoppage, computer failure or malfunction, or any and all
|
281
|
+
other commercial damages or losses), even if such Contributor
|
282
|
+
has been advised of the possibility of such damages.
|
283
|
+
|
284
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
285
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
286
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
287
|
+
or other liability obligations and/or rights consistent with this
|
288
|
+
License. However, in accepting such obligations, You may act only
|
289
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
290
|
+
of any other Contributor, and only if You agree to indemnify,
|
291
|
+
defend, and hold each Contributor harmless for any liability
|
292
|
+
incurred by, or claims asserted against, such Contributor by reason
|
293
|
+
of your accepting any such warranty or additional liability.
|
294
|
+
|
295
|
+
END OF TERMS AND CONDITIONS
|
296
|
+
|
297
|
+
APPENDIX: How to apply the Apache License to your work.
|
298
|
+
|
299
|
+
To apply the Apache License to your work, attach the following
|
300
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
301
|
+
replaced with your own identifying information. (Don't include
|
302
|
+
the brackets!) The text should be enclosed in the appropriate
|
303
|
+
comment syntax for the file format. We also recommend that a
|
304
|
+
file or class name and description of purpose be included on the
|
305
|
+
same "printed page" as the copyright notice for easier
|
306
|
+
identification within third-party archives.
|
307
|
+
|
308
|
+
Copyright [yyyy] [name of copyright owner]
|
309
|
+
|
310
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
311
|
+
you may not use this file except in compliance with the License.
|
312
|
+
You may obtain a copy of the License at
|
313
|
+
|
314
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
315
|
+
|
316
|
+
Unless required by applicable law or agreed to in writing, software
|
317
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
318
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
319
|
+
See the License for the specific language governing permissions and
|
320
|
+
limitations under the License.
|
321
|
+
|
322
|
+
|
102
323
|
### libxml2
|
103
324
|
|
104
325
|
MIT
|
data/LICENSE.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright 2008 -- 2021 by Mike Dalessio, Aaron Patterson, Yoko Harada, Akinori MUSHA, John Shahid, Karol Bucek, Lars Kanis, Sergio Arbeo, Timothy Elliott, Nobuyoshi Nakada, Charles Nutter, Patrick Mahoney.
|
3
|
+
Copyright 2008 -- 2021 by Mike Dalessio, Aaron Patterson, Yoko Harada, Akinori MUSHA, John Shahid, Karol Bucek, Sam Ruby, Craig Barnes, Stephen Checkoway, Lars Kanis, Sergio Arbeo, Timothy Elliott, Nobuyoshi Nakada, Charles Nutter, Patrick Mahoney.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
6
|
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Nokogiri
|
4
4
|
|
5
|
-
Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is fast and standards-compliant by relying on native parsers like libxml2 (C) and xerces (Java).
|
5
|
+
Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for [reading](https://nokogiri.org/tutorials/parsing_an_html_xml_document.html), writing, [modifying](https://nokogiri.org/tutorials/modifying_an_html_xml_document.html), and [querying](https://nokogiri.org/tutorials/searching_a_xml_html_document.html) documents. It is fast and standards-compliant by relying on native parsers like libxml2 (C) and xerces (Java).
|
6
6
|
|
7
7
|
## Guiding Principles
|
8
8
|
|
@@ -14,7 +14,7 @@ Some guiding principles Nokogiri tries to follow:
|
|
14
14
|
|
15
15
|
## Features Overview
|
16
16
|
|
17
|
-
- DOM Parser for XML and
|
17
|
+
- DOM Parser for XML, HTML4, and HTML5
|
18
18
|
- SAX Parser for XML and HTML4
|
19
19
|
- Push Parser for XML and HTML4
|
20
20
|
- Document search via XPath 1.0
|
@@ -26,10 +26,8 @@ Some guiding principles Nokogiri tries to follow:
|
|
26
26
|
|
27
27
|
## Status
|
28
28
|
|
29
|
-
[![
|
29
|
+
[![Github Actions CI](https://github.com/sparklemotion/nokogiri/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sparklemotion/nokogiri/actions/workflows/ci.yml)
|
30
30
|
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/xj2pqwvlxwuwgr06/branch/main?svg=true)](https://ci.appveyor.com/project/flavorjones/nokogiri/branch/main)
|
31
|
-
[![Code Climate](https://codeclimate.com/github/sparklemotion/nokogiri.svg)](https://codeclimate.com/github/sparklemotion/nokogiri)
|
32
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/59c67b0e8976027a45ad/test_coverage)](https://codeclimate.com/github/sparklemotion/nokogiri/test_coverage)
|
33
31
|
|
34
32
|
[![Gem Version](https://badge.fury.io/rb/nokogiri.svg)](https://rubygems.org/gems/nokogiri)
|
35
33
|
[![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=nokogiri&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score/?dependency-name=nokogiri&package-manager=bundler)
|
@@ -271,6 +269,9 @@ Some additional libraries may be distributed with your version of Nokogiri. Plea
|
|
271
269
|
- Akinori MUSHA
|
272
270
|
- John Shahid
|
273
271
|
- Karol Bucek
|
272
|
+
- Sam Ruby
|
273
|
+
- Craig Barnes
|
274
|
+
- Stephen Checkoway
|
274
275
|
- Lars Kanis
|
275
276
|
- Sergio Arbeo
|
276
277
|
- Timothy Elliott
|
@@ -18,13 +18,13 @@ import nokogiri.internals.HtmlDomParserContext;
|
|
18
18
|
import static nokogiri.internals.NokogiriHelpers.getNokogiriClass;
|
19
19
|
|
20
20
|
/**
|
21
|
-
* Class for Nokogiri::
|
21
|
+
* Class for Nokogiri::HTML4::Document.
|
22
22
|
*
|
23
23
|
* @author sergio
|
24
24
|
* @author Yoko Harada <yokolet@gmail.com>
|
25
25
|
*/
|
26
|
-
@JRubyClass(name = "Nokogiri::
|
27
|
-
public class
|
26
|
+
@JRubyClass(name = "Nokogiri::HTML4::Document", parent = "Nokogiri::XML::Document")
|
27
|
+
public class Html4Document extends XmlDocument
|
28
28
|
{
|
29
29
|
private static final String DEFAULT_CONTENT_TYPE = "html";
|
30
30
|
private static final String DEFAULT_PUBLIC_ID = "-//W3C//DTD HTML 4.01//EN";
|
@@ -33,19 +33,19 @@ public class HtmlDocument extends XmlDocument
|
|
33
33
|
private String parsed_encoding = null;
|
34
34
|
|
35
35
|
public
|
36
|
-
|
36
|
+
Html4Document(Ruby ruby, RubyClass klazz)
|
37
37
|
{
|
38
38
|
super(ruby, klazz);
|
39
39
|
}
|
40
40
|
|
41
41
|
public
|
42
|
-
|
42
|
+
Html4Document(Ruby runtime, Document document)
|
43
43
|
{
|
44
44
|
this(runtime, getNokogiriClass(runtime, "Nokogiri::XML::Document"), document);
|
45
45
|
}
|
46
46
|
|
47
47
|
public
|
48
|
-
|
48
|
+
Html4Document(Ruby ruby, RubyClass klazz, Document doc)
|
49
49
|
{
|
50
50
|
super(ruby, klazz, doc);
|
51
51
|
}
|
@@ -55,10 +55,10 @@ public class HtmlDocument extends XmlDocument
|
|
55
55
|
rbNew(ThreadContext context, IRubyObject klazz, IRubyObject[] args)
|
56
56
|
{
|
57
57
|
final Ruby runtime = context.runtime;
|
58
|
-
|
58
|
+
Html4Document htmlDocument;
|
59
59
|
try {
|
60
60
|
Document docNode = createNewDocument(runtime);
|
61
|
-
htmlDocument = (
|
61
|
+
htmlDocument = (Html4Document) NokogiriService.HTML_DOCUMENT_ALLOCATOR.allocate(runtime, (RubyClass) klazz);
|
62
62
|
htmlDocument.setDocumentNode(context.runtime, docNode);
|
63
63
|
} catch (Exception ex) {
|
64
64
|
throw asRuntimeError(runtime, "couldn't create document: ", ex);
|
@@ -135,13 +135,6 @@ public class HtmlDocument extends XmlDocument
|
|
135
135
|
return parsed_encoding;
|
136
136
|
}
|
137
137
|
|
138
|
-
/*
|
139
|
-
* call-seq:
|
140
|
-
* read_io(io, url, encoding, options)
|
141
|
-
*
|
142
|
-
* Read the HTML document from +io+ with given +url+, +encoding+,
|
143
|
-
* and +options+. See Nokogiri::HTML.parse
|
144
|
-
*/
|
145
138
|
@JRubyMethod(meta = true, required = 4)
|
146
139
|
public static IRubyObject
|
147
140
|
read_io(ThreadContext context, IRubyObject klass, IRubyObject[] args)
|
@@ -151,13 +144,6 @@ public class HtmlDocument extends XmlDocument
|
|
151
144
|
return ctx.parse(context, (RubyClass) klass, args[1]);
|
152
145
|
}
|
153
146
|
|
154
|
-
/*
|
155
|
-
* call-seq:
|
156
|
-
* read_memory(string, url, encoding, options)
|
157
|
-
*
|
158
|
-
* Read the HTML document contained in +string+ with given +url+, +encoding+,
|
159
|
-
* and +options+. See Nokogiri::HTML.parse
|
160
|
-
*/
|
161
147
|
@JRubyMethod(meta = true, required = 4)
|
162
148
|
public static IRubyObject
|
163
149
|
read_memory(ThreadContext context, IRubyObject klass, IRubyObject[] args)
|