nokogiri 1.13.6 → 1.13.9
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/dependencies.yml +8 -8
- data/ext/nokogiri/extconf.rb +18 -3
- data/ext/nokogiri/gumbo.c +1 -1
- data/ext/nokogiri/nokogiri.h +9 -0
- data/ext/nokogiri/xml_attr.c +2 -2
- data/ext/nokogiri/xml_attribute_decl.c +3 -3
- data/ext/nokogiri/xml_cdata.c +1 -1
- data/ext/nokogiri/xml_document.c +6 -2
- data/ext/nokogiri/xml_dtd.c +8 -8
- data/ext/nokogiri/xml_element_decl.c +3 -3
- data/ext/nokogiri/xml_entity_decl.c +5 -5
- data/ext/nokogiri/xml_namespace.c +41 -5
- data/ext/nokogiri/xml_node.c +86 -65
- data/ext/nokogiri/xml_node_set.c +4 -4
- data/ext/nokogiri/xml_reader.c +52 -1
- data/ext/nokogiri/xml_schema.c +3 -3
- data/ext/nokogiri/xml_text.c +1 -1
- data/ext/nokogiri/xml_xpath_context.c +4 -1
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/xml/reader.rb +6 -8
- data/ports/archives/libxml2-2.10.3.tar.xz +0 -0
- data/ports/archives/libxslt-1.1.37.tar.xz +0 -0
- metadata +15 -24
- data/patches/libxml2/0004-use-glibc-strlen.patch +0 -53
- data/patches/libxml2/0006-update-automake-files-for-arm64.patch +0 -3040
- data/patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch +0 -61
- data/ports/archives/libxml2-2.9.14.tar.xz +0 -0
- data/ports/archives/libxslt-1.1.35.tar.xz +0 -0
@@ -371,9 +371,12 @@ new (VALUE klass, VALUE nodeobj)
|
|
371
371
|
xmlXPathContextPtr ctx;
|
372
372
|
VALUE self;
|
373
373
|
|
374
|
-
|
374
|
+
Noko_Node_Get_Struct(nodeobj, xmlNode, node);
|
375
375
|
|
376
|
+
#if LIBXML_VERSION < 21000
|
377
|
+
/* deprecated in 40483d0 */
|
376
378
|
xmlXPathInit();
|
379
|
+
#endif
|
377
380
|
|
378
381
|
ctx = xmlXPathNewContext(node->doc);
|
379
382
|
ctx->node = node;
|
data/lib/nokogiri/xml/reader.rb
CHANGED
@@ -83,16 +83,14 @@ module Nokogiri
|
|
83
83
|
end
|
84
84
|
private :initialize
|
85
85
|
|
86
|
-
# Get the attributes of the current node as a Hash
|
86
|
+
# Get the attributes and namespaces of the current node as a Hash.
|
87
87
|
#
|
88
|
-
#
|
88
|
+
# This is the union of Reader#attribute_hash and Reader#namespaces
|
89
|
+
#
|
90
|
+
# [Returns]
|
91
|
+
# (Hash<String, String>) Attribute names and values, and namespace prefixes and hrefs.
|
89
92
|
def attributes
|
90
|
-
|
91
|
-
hash[node.name] = node.to_s
|
92
|
-
end
|
93
|
-
ns = namespaces
|
94
|
-
attrs_hash.merge!(ns) if ns
|
95
|
-
attrs_hash
|
93
|
+
attribute_hash.merge(namespaces)
|
96
94
|
end
|
97
95
|
|
98
96
|
###
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -20,7 +20,7 @@ authors:
|
|
20
20
|
autorequire:
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
|
-
date: 2022-
|
23
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mini_portile2
|
@@ -138,16 +138,16 @@ dependencies:
|
|
138
138
|
name: rake-compiler-dock
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
|
-
- -
|
141
|
+
- - '='
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
143
|
+
version: 1.2.2
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
146
|
version_requirements: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|
148
|
-
- -
|
148
|
+
- - '='
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
version:
|
150
|
+
version: 1.2.2
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
152
|
name: rdoc
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,20 +182,14 @@ dependencies:
|
|
182
182
|
requirements:
|
183
183
|
- - "~>"
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version:
|
186
|
-
- - ">="
|
187
|
-
- !ruby/object:Gem::Version
|
188
|
-
version: 1.28.2
|
185
|
+
version: 1.30.1
|
189
186
|
type: :development
|
190
187
|
prerelease: false
|
191
188
|
version_requirements: !ruby/object:Gem::Requirement
|
192
189
|
requirements:
|
193
190
|
- - "~>"
|
194
191
|
- !ruby/object:Gem::Version
|
195
|
-
version:
|
196
|
-
- - ">="
|
197
|
-
- !ruby/object:Gem::Version
|
198
|
-
version: 1.28.2
|
192
|
+
version: 1.30.1
|
199
193
|
- !ruby/object:Gem::Dependency
|
200
194
|
name: rubocop-minitest
|
201
195
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,16 +236,16 @@ dependencies:
|
|
242
236
|
name: rubocop-shopify
|
243
237
|
requirement: !ruby/object:Gem::Requirement
|
244
238
|
requirements:
|
245
|
-
- -
|
239
|
+
- - '='
|
246
240
|
- !ruby/object:Gem::Version
|
247
|
-
version:
|
241
|
+
version: 2.5.0
|
248
242
|
type: :development
|
249
243
|
prerelease: false
|
250
244
|
version_requirements: !ruby/object:Gem::Requirement
|
251
245
|
requirements:
|
252
|
-
- -
|
246
|
+
- - '='
|
253
247
|
- !ruby/object:Gem::Version
|
254
|
-
version:
|
248
|
+
version: 2.5.0
|
255
249
|
- !ruby/object:Gem::Dependency
|
256
250
|
name: ruby_memcheck
|
257
251
|
requirement: !ruby/object:Gem::Requirement
|
@@ -493,14 +487,11 @@ files:
|
|
493
487
|
- patches/libxml2/0001-Remove-script-macro-support.patch
|
494
488
|
- patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch
|
495
489
|
- patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch
|
496
|
-
- patches/libxml2/0004-use-glibc-strlen.patch
|
497
490
|
- patches/libxml2/0005-avoid-isnan-isinf.patch
|
498
|
-
- patches/libxml2/0006-update-automake-files-for-arm64.patch
|
499
|
-
- patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch
|
500
491
|
- patches/libxml2/0009-allow-wildcard-namespaces.patch
|
501
492
|
- patches/libxslt/0001-update-automake-files-for-arm64.patch
|
502
|
-
- ports/archives/libxml2-2.
|
503
|
-
- ports/archives/libxslt-1.1.
|
493
|
+
- ports/archives/libxml2-2.10.3.tar.xz
|
494
|
+
- ports/archives/libxslt-1.1.37.tar.xz
|
504
495
|
homepage: https://nokogiri.org
|
505
496
|
licenses:
|
506
497
|
- MIT
|
@@ -528,7 +519,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
528
519
|
- !ruby/object:Gem::Version
|
529
520
|
version: '0'
|
530
521
|
requirements: []
|
531
|
-
rubygems_version: 3.3.
|
522
|
+
rubygems_version: 3.3.7
|
532
523
|
signing_key:
|
533
524
|
specification_version: 4
|
534
525
|
summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
|
@@ -1,53 +0,0 @@
|
|
1
|
-
From c94172d2a4451368530db2186190d70be8a1d9e5 Mon Sep 17 00:00:00 2001
|
2
|
-
From: Ilya Zub <ilya@serpapi.com>
|
3
|
-
Date: Wed, 23 Dec 2020 12:45:29 +0200
|
4
|
-
Subject: Use glibc strlen to speed up xmlStrlen
|
5
|
-
MIME-Version: 1.0
|
6
|
-
Content-Type: text/plain; charset=UTF-8
|
7
|
-
Content-Transfer-Encoding: 8bit
|
8
|
-
|
9
|
-
xmlStrlen (entire HTML file): 926171.936981 μs
|
10
|
-
glibc_xmlStrlen (entire HTML file): 36905.903992 μs
|
11
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 25.094584 times
|
12
|
-
|
13
|
-
xmlStrlen (average string): 57479.204010 μs
|
14
|
-
glibc_xmlStrlen (average string): 5802.069000 μs
|
15
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 9.905937 times
|
16
|
-
|
17
|
-
xmlStrlen (bigger string): 388056.315979 μs
|
18
|
-
glibc_xmlStrlen (bigger string): 12797.856995 μs
|
19
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 30.318382 times
|
20
|
-
|
21
|
-
xmlStrlen (smallest string): 15870.046021 μs
|
22
|
-
glibc_xmlStrlen (smallest string): 6282.208984 μs
|
23
|
-
delta (xmlStrlen ÷ glibc_xmlStrlen): 2.527903 times
|
24
|
-
|
25
|
-
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/212 for reference.
|
26
|
-
---
|
27
|
-
xmlstring.c | 9 ++-------
|
28
|
-
1 file changed, 2 insertions(+), 7 deletions(-)
|
29
|
-
|
30
|
-
diff --git a/xmlstring.c b/xmlstring.c
|
31
|
-
index e8a1e45d..df247dff 100644
|
32
|
-
--- a/xmlstring.c
|
33
|
-
+++ b/xmlstring.c
|
34
|
-
@@ -423,12 +423,7 @@ xmlStrsub(const xmlChar *str, int start, int len) {
|
35
|
-
|
36
|
-
int
|
37
|
-
xmlStrlen(const xmlChar *str) {
|
38
|
-
- size_t len = 0;
|
39
|
-
-
|
40
|
-
if (str == NULL) return(0);
|
41
|
-
- while (*str != 0) { /* non input consuming */
|
42
|
-
- str++;
|
43
|
-
- len++;
|
44
|
-
- }
|
45
|
-
- return(len > INT_MAX ? 0 : len);
|
46
|
-
+
|
47
|
-
+ return strlen((const char*)str);
|
48
|
-
}
|
49
|
-
|
50
|
-
/**
|
51
|
-
--
|
52
|
-
2.29.2
|
53
|
-
|