nokogiri-html-ext 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/nokogiri/html_ext/document.rb +5 -11
- data/lib/nokogiri/html_ext/version.rb +1 -1
- 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: bcf8d54ec9864f58ba4ada5d6c47e191dbc0063249afb256928bf5fc52f5f0e0
|
4
|
+
data.tar.gz: 9c72dacd89707ad6d320e3ed368860b9f58ee73fadb8427a54012fa1c18282a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e589cf7989b82d9b73d265494c537c098a59236c4314cc758fda219e7b908dd0e9f22cb8ead7834def9ce74d27f223468f5394ee071c8be9df98ea391440623c
|
7
|
+
data.tar.gz: 3ffd78636127f753fde326de3b20b762a6b678583274425d2d6ad35827c305ab10711a40b1ed927251a4e6040ffa6585b9056161979ffdec0052da26fdbb1963
|
data/CHANGELOG.md
CHANGED
@@ -69,13 +69,15 @@ module Nokogiri
|
|
69
69
|
#
|
70
70
|
# @return [String]
|
71
71
|
def resolve_relative_url(url)
|
72
|
-
|
73
|
-
|
72
|
+
url_str = url.to_s
|
73
|
+
|
74
|
+
uri_parser.unescape(
|
75
|
+
uri_parser.join(*[document.url.strip, base_href, url_str].compact.map { |u| uri_parser.escape(u) })
|
74
76
|
.normalize
|
75
77
|
.to_s
|
76
78
|
)
|
77
79
|
rescue URI::InvalidComponentError, URI::InvalidURIError
|
78
|
-
|
80
|
+
url
|
79
81
|
end
|
80
82
|
|
81
83
|
# Convert the document's relative URLs to absolute URLs.
|
@@ -99,10 +101,6 @@ module Nokogiri
|
|
99
101
|
|
100
102
|
private
|
101
103
|
|
102
|
-
def escape(url)
|
103
|
-
uri_parser.escape(url.to_s)
|
104
|
-
end
|
105
|
-
|
106
104
|
def resolve_relative_urls_for(attributes_map)
|
107
105
|
attributes_map.each do |attribute, names|
|
108
106
|
xpaths = names.map { |name| "//#{name}[@#{attribute}]" }
|
@@ -113,10 +111,6 @@ module Nokogiri
|
|
113
111
|
end
|
114
112
|
end
|
115
113
|
|
116
|
-
def unescape(url)
|
117
|
-
uri_parser.unescape(url.to_s)
|
118
|
-
end
|
119
|
-
|
120
114
|
def uri_parser
|
121
115
|
@uri_parser ||= URI::DEFAULT_PARSER
|
122
116
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri-html-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
@@ -44,7 +44,7 @@ licenses:
|
|
44
44
|
- MIT
|
45
45
|
metadata:
|
46
46
|
bug_tracker_uri: https://github.com/jgarber623/nokogiri-html-ext/issues
|
47
|
-
changelog_uri: https://github.com/jgarber623/nokogiri-html-ext/blob/v0.2.
|
47
|
+
changelog_uri: https://github.com/jgarber623/nokogiri-html-ext/blob/v0.2.2/CHANGELOG.md
|
48
48
|
rubygems_mfa_required: 'true'
|
49
49
|
post_install_message:
|
50
50
|
rdoc_options: []
|