nokogiri 1.13.1-x64-mingw32 → 1.13.4-x64-mingw32
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/Gemfile +0 -3
- data/dependencies.yml +8 -58
- data/ext/nokogiri/extconf.rb +19 -11
- data/ext/nokogiri/include/libexslt/exslt.h +6 -0
- data/ext/nokogiri/include/libexslt/exsltconfig.h +1 -1
- data/ext/nokogiri/include/libexslt/exsltexports.h +3 -3
- data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +5 -5
- data/ext/nokogiri/include/libxslt/extensions.h +1 -1
- data/ext/nokogiri/include/libxslt/preproc.h +1 -1
- data/ext/nokogiri/include/libxslt/xsltInternals.h +15 -11
- data/ext/nokogiri/include/libxslt/xsltconfig.h +4 -4
- data/lib/nokogiri/2.6/nokogiri.so +0 -0
- data/lib/nokogiri/2.7/nokogiri.so +0 -0
- data/lib/nokogiri/3.0/nokogiri.so +0 -0
- data/lib/nokogiri/css/parser_extras.rb +2 -0
- data/lib/nokogiri/html4/document.rb +5 -3
- data/lib/nokogiri/html4/sax/parser.rb +2 -0
- data/lib/nokogiri/html5/document.rb +3 -0
- data/lib/nokogiri/html5/node.rb +4 -0
- data/lib/nokogiri/html5.rb +1 -0
- data/lib/nokogiri/version/constant.rb +1 -1
- data/lib/nokogiri/version/info.rb +1 -0
- data/lib/nokogiri/xml/builder.rb +2 -0
- data/lib/nokogiri/xml/document.rb +5 -0
- data/lib/nokogiri/xml/node/save_options.rb +2 -1
- data/lib/nokogiri/xml/node.rb +9 -3
- data/lib/nokogiri/xml/node_set.rb +4 -0
- data/lib/nokogiri/xml/parse_options.rb +1 -0
- data/lib/nokogiri/xml/processing_instruction.rb +1 -1
- data/lib/nokogiri/xml/sax/parser.rb +1 -0
- data/lib/nokogiri/xml/syntax_error.rb +1 -0
- data/lib/nokogiri/xml.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3ca6a6e9fee66b77c7b6cd104bbba99081d322be177bc10ba0dfcb798fe2830
|
4
|
+
data.tar.gz: 45aecd4093cda7b5e3beccf82a739ac6e1171db9247c9b1f8e22a66994e53550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 590c877850b87886da8055c61e604492775fdade6d110a0d7e4ed8ed04628c2c7f65a8cd0dd56aee065f31f80951ad489cff816862af1e065d4aa748112c32b4
|
7
|
+
data.tar.gz: a0ffd3121ec6f4b419b2c90d0e6376bf62cb089dc8a4ebeccb1ad3e2731ea21cf0a6a6554c53b28e62bae3b15ca5f39793c900d33ae13ae0d19a984a422194f4
|
data/Gemfile
CHANGED
data/dependencies.yml
CHANGED
@@ -1,66 +1,16 @@
|
|
1
1
|
libxml2:
|
2
|
-
version: "2.9.
|
3
|
-
sha256: "
|
4
|
-
#
|
5
|
-
#
|
6
|
-
# $ gpg --verify libxml2-2.9.12.tar.gz.asc ports/archives/libxml2-2.9.12.tar.gz
|
7
|
-
# gpg: Signature made Thu 13 May 2021 02:59:16 PM EDT
|
8
|
-
# gpg: using RSA key DB46681BB91ADCEA170FA2D415588B26596BEA5D
|
9
|
-
# gpg: Good signature from "Daniel Veillard (Red Hat work email) <veillard@redhat.com>" [unknown]
|
10
|
-
# gpg: aka "Daniel Veillard <Daniel.Veillard@w3.org>" [unknown]
|
11
|
-
# gpg: WARNING: This key is not certified with a trusted signature!
|
12
|
-
# gpg: There is no indication that the signature belongs to the owner.
|
13
|
-
# Primary key fingerprint: C744 15BA 7C9C 7F78 F02E 1DC3 4606 B8A5 DE95 BC1F
|
14
|
-
# Subkey fingerprint: DB46 681B B91A DCEA 170F A2D4 1558 8B26 596B EA5D
|
15
|
-
#
|
16
|
-
# using this pgp signature:
|
17
|
-
#
|
18
|
-
# -----BEGIN PGP SIGNATURE-----
|
19
|
-
#
|
20
|
-
# iQEzBAABCAAdFiEE20ZoG7ka3OoXD6LUFViLJllr6l0FAmCddwQACgkQFViLJllr
|
21
|
-
# 6l11LQgAioRTdfmcC+uK/7+6HPtF/3c5zkX6j8VGYuvFBwZ0jayqMRBAl++fcpjE
|
22
|
-
# JUU/JKebSZ/KCYjzyeOWK/i3Gq77iqm3UbZFB85rqu4a5P3gmj/4STWVyAx0KU3z
|
23
|
-
# G3jKqDhJOt7c0acXb5lh2DngfDa1dn/VGcQcIXsqplNxNr4ET7MnSJjZ3nlxYfW2
|
24
|
-
# E5vWBdPCMUeXDBl6MjYvw9XnGGBLUAaEJWoFToG6jKmVf4GAd9nza20jj5dtbcJq
|
25
|
-
# QEOaSDKDr+f9h2NS8haOhJ9vOpy52PdeGzaFlbRkXarGXuAr8kITgATVs8FAqcgv
|
26
|
-
# MoVhmrO5r2hJf0dCM9fZoYqzpMfmNA==
|
27
|
-
# =KfJ9
|
28
|
-
# -----END PGP SIGNATURE-----
|
29
|
-
#
|
2
|
+
version: "2.9.13"
|
3
|
+
sha256: "276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e"
|
4
|
+
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.13.sha256sum
|
30
5
|
|
31
6
|
libxslt:
|
32
|
-
version: "1.1.
|
33
|
-
sha256: "
|
34
|
-
#
|
35
|
-
#
|
36
|
-
# $ gpg --verify ~/Downloads/libxslt-1.1.34.tar.gz.asc ports/archives/libxslt-1.1.34.tar.gz
|
37
|
-
# gpg: Signature made Wed 30 Oct 2019 04:02:48 PM EDT
|
38
|
-
# gpg: using RSA key DB46681BB91ADCEA170FA2D415588B26596BEA5D
|
39
|
-
# gpg: Good signature from "Daniel Veillard (Red Hat work email) <veillard@redhat.com>" [unknown]
|
40
|
-
# gpg: aka "Daniel Veillard <Daniel.Veillard@w3.org>" [unknown]
|
41
|
-
# gpg: WARNING: This key is not certified with a trusted signature!
|
42
|
-
# gpg: There is no indication that the signature belongs to the owner.
|
43
|
-
# Primary key fingerprint: C744 15BA 7C9C 7F78 F02E 1DC3 4606 B8A5 DE95 BC1F
|
44
|
-
# Subkey fingerprint: DB46 681B B91A DCEA 170F A2D4 1558 8B26 596B EA5D
|
45
|
-
#
|
46
|
-
# using this pgp signature:
|
47
|
-
#
|
48
|
-
# -----BEGIN PGP SIGNATURE-----
|
49
|
-
#
|
50
|
-
# iQEzBAABCAAdFiEE20ZoG7ka3OoXD6LUFViLJllr6l0FAl257GgACgkQFViLJllr
|
51
|
-
# 6l2vVggAjJEHmASiS56SxhPOsGqbfBihM66gQFoIymQfMu2430N1GSTkLsfbkJO8
|
52
|
-
# 8yBX11NjzK/m9uxwshMW3rVCU7EpL3PUimN3reXdPiQj9hAOAWF1V3BZNevbQC2E
|
53
|
-
# FCIraioukaidf8sjUG4/sGpK/gOcP/3hYoN0HUoBigCNJjDqhijxM3M3GJJtCASp
|
54
|
-
# jL4CQbs2OmxW8ixOZbuWEESvFFHUgYRsdZjRVN+GRfSOvJjxypurmYwQ3RjO7JxL
|
55
|
-
# 2FY8qKQ+xpeID8NV8F5OUEvWBjk1QS133VTqBZNlONdnEtV/og6jNu5k0O/Kvhup
|
56
|
-
# caR+8TMErOcLr9OgDklO6DoYyAsf9Q==
|
57
|
-
# =g4i4
|
58
|
-
# -----END PGP SIGNATURE-----
|
59
|
-
#
|
7
|
+
version: "1.1.35"
|
8
|
+
sha256: "8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79"
|
9
|
+
# sha-256 hash provided in https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.35.sha256sum
|
60
10
|
|
61
11
|
zlib:
|
62
|
-
version: "1.2.
|
63
|
-
sha256: "
|
12
|
+
version: "1.2.12"
|
13
|
+
sha256: "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9"
|
64
14
|
# SHA-256 hash provided on http://zlib.net/
|
65
15
|
|
66
16
|
libiconv:
|
data/ext/nokogiri/extconf.rb
CHANGED
@@ -15,7 +15,7 @@ PACKAGE_ROOT_DIR = File.expand_path(File.join(File.dirname(__FILE__), "..", ".."
|
|
15
15
|
REQUIRED_LIBXML_VERSION = "2.6.21"
|
16
16
|
RECOMMENDED_LIBXML_VERSION = "2.9.3"
|
17
17
|
|
18
|
-
REQUIRED_MINI_PORTILE_VERSION = "~> 2.
|
18
|
+
REQUIRED_MINI_PORTILE_VERSION = "~> 2.8.0" # keep this version in sync with the one in the gemspec
|
19
19
|
REQUIRED_PKG_CONFIG_VERSION = "~> 1.1"
|
20
20
|
|
21
21
|
# Keep track of what versions of what libraries we build against
|
@@ -211,6 +211,18 @@ def local_have_library(lib, func = nil, headers = nil)
|
|
211
211
|
have_library(lib, func, headers) || have_library("lib#{lib}", func, headers)
|
212
212
|
end
|
213
213
|
|
214
|
+
def gnome_source
|
215
|
+
# As of 2022-02-20, some mirrors have expired SSL certificates. I'm able to retrieve from my home,
|
216
|
+
# but whatever host is resolved on the github actions workers see an expired cert.
|
217
|
+
#
|
218
|
+
# See https://github.com/sparklemotion/nokogiri/runs/5266206403?check_suite_focus=true
|
219
|
+
if ENV["NOKOGIRI_USE_CANONICAL_GNOME_SOURCE"]
|
220
|
+
"https://download.gnome.org"
|
221
|
+
else
|
222
|
+
"https://mirror.csclub.uwaterloo.ca/gnome" # old reliable
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
214
226
|
LOCAL_PACKAGE_RESPONSE = Object.new
|
215
227
|
def LOCAL_PACKAGE_RESPONSE.%(package)
|
216
228
|
package ? "yes: #{package}" : "no"
|
@@ -370,6 +382,7 @@ def iconv_configure_flags
|
|
370
382
|
["iconv", "opt"].each do |target|
|
371
383
|
config = preserving_globals { dir_config(target) }
|
372
384
|
next unless config.any? && try_link_iconv("--with-#{target}-* flags") { dir_config(target) }
|
385
|
+
|
373
386
|
idirs, ldirs = config.map do |dirs|
|
374
387
|
Array(dirs).flat_map do |dir|
|
375
388
|
dir.split(File::PATH_SEPARATOR)
|
@@ -512,6 +525,7 @@ def process_recipe(name, version, static_p, cross_p, cacheable_p = true)
|
|
512
525
|
|
513
526
|
EOM
|
514
527
|
|
528
|
+
pp(recipe.files)
|
515
529
|
chdir_for_build { recipe.cook }
|
516
530
|
FileUtils.touch(checkpoint)
|
517
531
|
end
|
@@ -702,14 +716,6 @@ else
|
|
702
716
|
execute("configure",
|
703
717
|
["env", "CHOST=#{host}", "CFLAGS=#{cflags}", "./configure", "--static", configure_prefix])
|
704
718
|
end
|
705
|
-
|
706
|
-
def compile
|
707
|
-
if /darwin/.match?(host)
|
708
|
-
execute("compile", "make AR=#{host}-libtool")
|
709
|
-
else
|
710
|
-
super
|
711
|
-
end
|
712
|
-
end
|
713
719
|
end
|
714
720
|
end
|
715
721
|
end
|
@@ -770,8 +776,9 @@ else
|
|
770
776
|
if source_dir
|
771
777
|
recipe.source_directory = source_dir
|
772
778
|
else
|
779
|
+
minor_version = Gem::Version.new(recipe.version).segments.take(2).join(".")
|
773
780
|
recipe.files = [{
|
774
|
-
url: "
|
781
|
+
url: "#{gnome_source}/sources/libxml2/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz",
|
775
782
|
sha256: dependencies["libxml2"]["sha256"],
|
776
783
|
}]
|
777
784
|
recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxml2", "*.patch")].sort
|
@@ -818,8 +825,9 @@ else
|
|
818
825
|
if source_dir
|
819
826
|
recipe.source_directory = source_dir
|
820
827
|
else
|
828
|
+
minor_version = Gem::Version.new(recipe.version).segments.take(2).join(".")
|
821
829
|
recipe.files = [{
|
822
|
-
url: "
|
830
|
+
url: "#{gnome_source}/sources/libxslt/#{minor_version}/#{recipe.name}-#{recipe.version}.tar.xz",
|
823
831
|
sha256: dependencies["libxslt"]["sha256"],
|
824
832
|
}]
|
825
833
|
recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxslt", "*.patch")].sort
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/*
|
2
|
-
*
|
2
|
+
* Summary: macros for marking symbols as exportable/importable.
|
3
3
|
*
|
4
|
-
* See Copyright for the status of this software.
|
4
|
+
* Copy: See Copyright for the status of this software.
|
5
5
|
*
|
6
|
-
* igor@zlatkovic.com
|
6
|
+
* Author: Igor Zlatkovic <igor@zlatkovic.com>
|
7
7
|
*/
|
8
8
|
|
9
9
|
#ifndef __EXSLT_EXPORTS_H__
|
@@ -29,26 +29,26 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
|
29
29
|
*
|
30
30
|
* the version string like "1.2.3"
|
31
31
|
*/
|
32
|
-
#define LIBXML_DOTTED_VERSION "2.9.
|
32
|
+
#define LIBXML_DOTTED_VERSION "2.9.13"
|
33
33
|
|
34
34
|
/**
|
35
35
|
* LIBXML_VERSION:
|
36
36
|
*
|
37
37
|
* the version number: 1.2.3 value is 10203
|
38
38
|
*/
|
39
|
-
#define LIBXML_VERSION
|
39
|
+
#define LIBXML_VERSION 20913
|
40
40
|
|
41
41
|
/**
|
42
42
|
* LIBXML_VERSION_STRING:
|
43
43
|
*
|
44
44
|
* the version number string, 1.2.3 value is "10203"
|
45
45
|
*/
|
46
|
-
#define LIBXML_VERSION_STRING "
|
46
|
+
#define LIBXML_VERSION_STRING "20913"
|
47
47
|
|
48
48
|
/**
|
49
49
|
* LIBXML_VERSION_EXTRA:
|
50
50
|
*
|
51
|
-
* extra version information, used to show a
|
51
|
+
* extra version information, used to show a git commit description
|
52
52
|
*/
|
53
53
|
#define LIBXML_VERSION_EXTRA ""
|
54
54
|
|
@@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
|
58
58
|
* Macro to check that the libxml version in use is compatible with
|
59
59
|
* the version the software has been compiled against
|
60
60
|
*/
|
61
|
-
#define LIBXML_TEST_VERSION xmlCheckVersion(
|
61
|
+
#define LIBXML_TEST_VERSION xmlCheckVersion(20913);
|
62
62
|
|
63
63
|
#ifndef VMS
|
64
64
|
#if 0
|
@@ -291,6 +291,9 @@ struct _xsltTemplate {
|
|
291
291
|
int templMax; /* Size of the templtes stack */
|
292
292
|
xsltTemplatePtr *templCalledTab; /* templates called */
|
293
293
|
int *templCountTab; /* .. and how often */
|
294
|
+
|
295
|
+
/* Conflict resolution */
|
296
|
+
int position;
|
294
297
|
};
|
295
298
|
|
296
299
|
/**
|
@@ -1500,17 +1503,18 @@ struct _xsltStylesheet {
|
|
1500
1503
|
/*
|
1501
1504
|
* Template descriptions.
|
1502
1505
|
*/
|
1503
|
-
xsltTemplatePtr templates;
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1506
|
+
xsltTemplatePtr templates; /* the ordered list of templates */
|
1507
|
+
xmlHashTablePtr templatesHash; /* hash table or wherever compiled
|
1508
|
+
templates information is stored */
|
1509
|
+
struct _xsltCompMatch *rootMatch; /* template based on / */
|
1510
|
+
struct _xsltCompMatch *keyMatch; /* template based on key() */
|
1511
|
+
struct _xsltCompMatch *elemMatch; /* template based on * */
|
1512
|
+
struct _xsltCompMatch *attrMatch; /* template based on @* */
|
1513
|
+
struct _xsltCompMatch *parentMatch; /* template based on .. */
|
1514
|
+
struct _xsltCompMatch *textMatch; /* template based on text() */
|
1515
|
+
struct _xsltCompMatch *piMatch; /* template based on
|
1516
|
+
processing-instruction() */
|
1517
|
+
struct _xsltCompMatch *commentMatch; /* template based on comment() */
|
1514
1518
|
|
1515
1519
|
/*
|
1516
1520
|
* Namespace aliases.
|
@@ -20,21 +20,21 @@ extern "C" {
|
|
20
20
|
*
|
21
21
|
* the version string like "1.2.3"
|
22
22
|
*/
|
23
|
-
#define LIBXSLT_DOTTED_VERSION "1.1.
|
23
|
+
#define LIBXSLT_DOTTED_VERSION "1.1.35"
|
24
24
|
|
25
25
|
/**
|
26
26
|
* LIBXSLT_VERSION:
|
27
27
|
*
|
28
28
|
* the version number: 1.2.3 value is 10203
|
29
29
|
*/
|
30
|
-
#define LIBXSLT_VERSION
|
30
|
+
#define LIBXSLT_VERSION 10135
|
31
31
|
|
32
32
|
/**
|
33
33
|
* LIBXSLT_VERSION_STRING:
|
34
34
|
*
|
35
35
|
* the version number string, 1.2.3 value is "10203"
|
36
36
|
*/
|
37
|
-
#define LIBXSLT_VERSION_STRING "
|
37
|
+
#define LIBXSLT_VERSION_STRING "10135"
|
38
38
|
|
39
39
|
/**
|
40
40
|
* LIBXSLT_VERSION_EXTRA:
|
@@ -133,7 +133,7 @@ extern "C" {
|
|
133
133
|
#ifndef WITH_MODULES
|
134
134
|
#define WITH_MODULES
|
135
135
|
#endif
|
136
|
-
#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/home/flavorjones/code/oss/nokogiri/ports/x64-mingw32/libxslt/1.1.
|
136
|
+
#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/home/flavorjones/code/oss/nokogiri/ports/x64-mingw32/libxslt/1.1.35/lib/libxslt-plugins"
|
137
137
|
#endif
|
138
138
|
|
139
139
|
/**
|
Binary file
|
Binary file
|
Binary file
|
@@ -24,12 +24,14 @@ module Nokogiri
|
|
24
24
|
# Get the css selector in +string+ from the cache
|
25
25
|
def [](string)
|
26
26
|
return nil unless cache_on?
|
27
|
+
|
27
28
|
@mutex.synchronize { @cache[string] }
|
28
29
|
end
|
29
30
|
|
30
31
|
# Set the css selector in +string+ in the cache to +value+
|
31
32
|
def []=(string, value)
|
32
33
|
return value unless cache_on?
|
34
|
+
|
33
35
|
@mutex.synchronize { @cache[string] = value }
|
34
36
|
end
|
35
37
|
|
@@ -125,8 +125,9 @@ module Nokogiri
|
|
125
125
|
private :set_metadata_element
|
126
126
|
|
127
127
|
####
|
128
|
-
# Serialize Node using +options+.
|
129
|
-
#
|
128
|
+
# Serialize Node using +options+. Save options can also be set using a block.
|
129
|
+
#
|
130
|
+
# See also Nokogiri::XML::Node::SaveOptions and Node@Serialization+and+Generating+Output.
|
130
131
|
#
|
131
132
|
# These two statements are equivalent:
|
132
133
|
#
|
@@ -241,6 +242,7 @@ module Nokogiri
|
|
241
242
|
|
242
243
|
def start_element(name, attrs = [])
|
243
244
|
return unless name == "meta"
|
245
|
+
|
244
246
|
attr = Hash[attrs]
|
245
247
|
(charset = attr["charset"]) &&
|
246
248
|
(@encoding = charset)
|
@@ -266,7 +268,7 @@ module Nokogiri
|
|
266
268
|
end
|
267
269
|
|
268
270
|
def self.detect_encoding(chunk)
|
269
|
-
(m = chunk.match(/\A(<\?xml[ \t\r\n]
|
271
|
+
(m = chunk.match(/\A(<\?xml[ \t\r\n][^>]*>)/)) &&
|
270
272
|
(return Nokogiri.XML(m[1]).encoding)
|
271
273
|
|
272
274
|
if Nokogiri.jruby?
|
@@ -30,6 +30,7 @@ module Nokogiri
|
|
30
30
|
def parse_memory(data, encoding = "UTF-8")
|
31
31
|
raise ArgumentError unless data
|
32
32
|
return if data.empty?
|
33
|
+
|
33
34
|
ctx = ParserContext.memory(data, encoding)
|
34
35
|
yield ctx if block_given?
|
35
36
|
ctx.parse_with(self)
|
@@ -51,6 +52,7 @@ module Nokogiri
|
|
51
52
|
raise ArgumentError unless filename
|
52
53
|
raise Errno::ENOENT unless File.exist?(filename)
|
53
54
|
raise Errno::EISDIR if File.directory?(filename)
|
55
|
+
|
54
56
|
ctx = ParserContext.file(filename, encoding)
|
55
57
|
yield ctx if block_given?
|
56
58
|
ctx.parse_with(self)
|
@@ -39,16 +39,19 @@ module Nokogiri
|
|
39
39
|
unless string_or_io.respond_to?(:read) || string_or_io.respond_to?(:to_str)
|
40
40
|
raise ArgumentError, "not a string or IO object"
|
41
41
|
end
|
42
|
+
|
42
43
|
do_parse(string_or_io, url, encoding, options)
|
43
44
|
end
|
44
45
|
|
45
46
|
def self.read_io(io, url = nil, encoding = nil, **options)
|
46
47
|
raise ArgumentError, "io object doesn't respond to :read" unless io.respond_to?(:read)
|
48
|
+
|
47
49
|
do_parse(io, url, encoding, options)
|
48
50
|
end
|
49
51
|
|
50
52
|
def self.read_memory(string, url = nil, encoding = nil, **options)
|
51
53
|
raise ArgumentError, "string object doesn't respond to :to_str" unless string.respond_to?(:to_str)
|
54
|
+
|
52
55
|
do_parse(string, url, encoding, options)
|
53
56
|
end
|
54
57
|
|
data/lib/nokogiri/html5/node.rb
CHANGED
@@ -27,6 +27,7 @@ module Nokogiri
|
|
27
27
|
module Node
|
28
28
|
def inner_html(options = {})
|
29
29
|
return super(options) unless document.is_a?(HTML5::Document)
|
30
|
+
|
30
31
|
result = options[:preserve_newline] && HTML5.prepend_newline?(self) ? +"\n" : +""
|
31
32
|
result << children.map { |child| child.to_html(options) }.join
|
32
33
|
result
|
@@ -34,6 +35,7 @@ module Nokogiri
|
|
34
35
|
|
35
36
|
def write_to(io, *options)
|
36
37
|
return super(io, *options) unless document.is_a?(HTML5::Document)
|
38
|
+
|
37
39
|
options = options.first.is_a?(Hash) ? options.shift : {}
|
38
40
|
encoding = options[:encoding] || options[0]
|
39
41
|
if Nokogiri.jruby?
|
@@ -64,6 +66,7 @@ module Nokogiri
|
|
64
66
|
|
65
67
|
def fragment(tags)
|
66
68
|
return super(tags) unless document.is_a?(HTML5::Document)
|
69
|
+
|
67
70
|
DocumentFragment.new(document, tags, self)
|
68
71
|
end
|
69
72
|
|
@@ -76,6 +79,7 @@ module Nokogiri
|
|
76
79
|
# actually create the xml namespace if it doesn't exist already.
|
77
80
|
def add_child_node_and_reparent_attrs(node)
|
78
81
|
return super(node) unless document.is_a?(HTML5::Document)
|
82
|
+
|
79
83
|
# I'm not sure what this method is supposed to do. Reparenting
|
80
84
|
# namespaces is handled by libxml2, including child namespaces which
|
81
85
|
# this method wouldn't handle.
|
data/lib/nokogiri/html5.rb
CHANGED
@@ -468,6 +468,7 @@ module Nokogiri
|
|
468
468
|
|
469
469
|
def self.prepend_newline?(node)
|
470
470
|
return false unless ["pre", "textarea", "listing"].include?(node.name) && !node.children.empty?
|
471
|
+
|
471
472
|
first_child = node.children[0]
|
472
473
|
first_child.text? && first_child.content.start_with?("\n")
|
473
474
|
end
|
@@ -191,6 +191,7 @@ module Nokogiri
|
|
191
191
|
def self.uses_libxml?(requirement = nil)
|
192
192
|
return false unless VersionInfo.instance.libxml2?
|
193
193
|
return true unless requirement
|
194
|
+
|
194
195
|
Gem::Requirement.new(requirement).satisfied_by?(VersionInfo.instance.loaded_libxml_version)
|
195
196
|
end
|
196
197
|
|
data/lib/nokogiri/xml/builder.rb
CHANGED
@@ -363,6 +363,7 @@ module Nokogiri
|
|
363
363
|
|
364
364
|
@parent.ancestors.each do |a|
|
365
365
|
next if a == doc
|
366
|
+
|
366
367
|
@ns = a.namespace_definitions.find { |x| x.prefix == ns.to_s }
|
367
368
|
return self if @ns
|
368
369
|
end
|
@@ -407,6 +408,7 @@ module Nokogiri
|
|
407
408
|
if node.namespace.nil?
|
408
409
|
raise ArgumentError, "Namespace #{@ns[:pending]} has not been defined"
|
409
410
|
end
|
411
|
+
|
410
412
|
@ns = nil
|
411
413
|
end
|
412
414
|
|
@@ -321,6 +321,7 @@ module Nokogiri
|
|
321
321
|
# the document or +nil+ when there is no DTD.
|
322
322
|
def validate
|
323
323
|
return nil unless internal_subset
|
324
|
+
|
324
325
|
internal_subset.validate(self)
|
325
326
|
end
|
326
327
|
|
@@ -353,8 +354,10 @@ module Nokogiri
|
|
353
354
|
# Apply any decorators to +node+
|
354
355
|
def decorate(node)
|
355
356
|
return unless @decorators
|
357
|
+
|
356
358
|
@decorators.each do |klass, list|
|
357
359
|
next unless node.is_a?(klass)
|
360
|
+
|
358
361
|
list.each { |moodule| node.extend(moodule) }
|
359
362
|
end
|
360
363
|
end
|
@@ -380,9 +383,11 @@ module Nokogiri
|
|
380
383
|
|
381
384
|
def add_child(node_or_tags)
|
382
385
|
raise "A document may not have multiple root nodes." if (root && root.name != "nokogiri_text_wrapper") && !(node_or_tags.comment? || node_or_tags.processing_instruction?)
|
386
|
+
|
383
387
|
node_or_tags = coerce(node_or_tags)
|
384
388
|
if node_or_tags.is_a?(XML::NodeSet)
|
385
389
|
raise "A document may not have multiple root nodes." if node_or_tags.size > 1
|
390
|
+
|
386
391
|
super(node_or_tags.first)
|
387
392
|
else
|
388
393
|
super
|
@@ -4,7 +4,8 @@ module Nokogiri
|
|
4
4
|
module XML
|
5
5
|
class Node
|
6
6
|
###
|
7
|
-
# Save options for serializing nodes
|
7
|
+
# Save options for serializing nodes.
|
8
|
+
# See the method group entitled Node@Serialization+and+Generating+Output for usage.
|
8
9
|
class SaveOptions
|
9
10
|
# Format serialized xml
|
10
11
|
FORMAT = 1
|
data/lib/nokogiri/xml/node.rb
CHANGED
@@ -123,7 +123,7 @@ module Nokogiri
|
|
123
123
|
# [Yields] Nokogiri::XML::Node
|
124
124
|
# [Returns] Nokogiri::XML::Node
|
125
125
|
#
|
126
|
-
def initialize(name, document)
|
126
|
+
def initialize(name, document) # rubocop:disable Style/RedundantInitialize
|
127
127
|
# This is intentionally empty.
|
128
128
|
end
|
129
129
|
|
@@ -163,6 +163,7 @@ module Nokogiri
|
|
163
163
|
if (first = children.first)
|
164
164
|
# Mimic the error add_child would raise.
|
165
165
|
raise "Document already has a root node" if document? && !(node_or_tags.comment? || node_or_tags.processing_instruction?)
|
166
|
+
|
166
167
|
first.__send__(:add_sibling, :previous, node_or_tags)
|
167
168
|
else
|
168
169
|
add_child(node_or_tags)
|
@@ -1072,6 +1073,7 @@ module Nokogiri
|
|
1072
1073
|
# nil on XML documents and on unknown tags.
|
1073
1074
|
def description
|
1074
1075
|
return nil if document.xml?
|
1076
|
+
|
1075
1077
|
Nokogiri::HTML4::ElementDescription[name]
|
1076
1078
|
end
|
1077
1079
|
|
@@ -1119,6 +1121,7 @@ module Nokogiri
|
|
1119
1121
|
|
1120
1122
|
while parents.last.respond_to?(:parent)
|
1121
1123
|
break unless (ctx_parent = parents.last.parent)
|
1124
|
+
|
1122
1125
|
parents << ctx_parent
|
1123
1126
|
end
|
1124
1127
|
|
@@ -1150,6 +1153,7 @@ module Nokogiri
|
|
1150
1153
|
def ==(other)
|
1151
1154
|
return false unless other
|
1152
1155
|
return false unless other.respond_to?(:pointer_id)
|
1156
|
+
|
1153
1157
|
pointer_id == other.pointer_id
|
1154
1158
|
end
|
1155
1159
|
|
@@ -1159,14 +1163,16 @@ module Nokogiri
|
|
1159
1163
|
def <=>(other)
|
1160
1164
|
return nil unless other.is_a?(Nokogiri::XML::Node)
|
1161
1165
|
return nil unless document == other.document
|
1166
|
+
|
1162
1167
|
compare(other)
|
1163
1168
|
end
|
1164
1169
|
|
1165
1170
|
# :section: Serialization and Generating Output
|
1166
1171
|
|
1167
1172
|
###
|
1168
|
-
# Serialize Node using +options+.
|
1169
|
-
#
|
1173
|
+
# Serialize Node using +options+. Save options can also be set using a block.
|
1174
|
+
#
|
1175
|
+
# See also Nokogiri::XML::Node::SaveOptions and Node@Serialization+and+Generating+Output.
|
1170
1176
|
#
|
1171
1177
|
# These two statements are equivalent:
|
1172
1178
|
#
|
@@ -27,6 +27,7 @@ module Nokogiri
|
|
27
27
|
# Get the first element of the NodeSet.
|
28
28
|
def first(n = nil)
|
29
29
|
return self[0] unless n
|
30
|
+
|
30
31
|
list = []
|
31
32
|
[n, length].min.times { |i| list << self[i] }
|
32
33
|
list
|
@@ -304,6 +305,7 @@ module Nokogiri
|
|
304
305
|
# the set is empty
|
305
306
|
def pop
|
306
307
|
return nil if length == 0
|
308
|
+
|
307
309
|
delete(last)
|
308
310
|
end
|
309
311
|
|
@@ -312,6 +314,7 @@ module Nokogiri
|
|
312
314
|
# +nil+ if the set is empty.
|
313
315
|
def shift
|
314
316
|
return nil if length == 0
|
317
|
+
|
315
318
|
delete(first)
|
316
319
|
end
|
317
320
|
|
@@ -322,6 +325,7 @@ module Nokogiri
|
|
322
325
|
def ==(other)
|
323
326
|
return false unless other.is_a?(Nokogiri::XML::NodeSet)
|
324
327
|
return false unless length == other.length
|
328
|
+
|
325
329
|
each_with_index do |node, i|
|
326
330
|
return false unless node == other[i]
|
327
331
|
end
|
@@ -101,6 +101,7 @@ module Nokogiri
|
|
101
101
|
raise ArgumentError unless filename
|
102
102
|
raise Errno::ENOENT unless File.exist?(filename)
|
103
103
|
raise Errno::EISDIR if File.directory?(filename)
|
104
|
+
|
104
105
|
ctx = ParserContext.file(filename)
|
105
106
|
yield ctx if block_given?
|
106
107
|
ctx.parse_with(self)
|
data/lib/nokogiri/xml.rb
CHANGED
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.4
|
5
5
|
platform: x64-mingw32
|
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-04-11 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: racc
|