nokogiri-html-ext 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -5
- data/lib/nokogiri/html_ext/document.rb +11 -3
- 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: 5b7b920edbff5d762b7c2da37c37b59ae2455e0d1991b74595856098749e4fce
|
4
|
+
data.tar.gz: 457aa965cba9c5a01802efd664b5accc08298691d9b05a0f5dcf8c05e9fb37f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80fa06b7ffbbce44179b2f44aa19f42d70eb82145d8c52fd2a3eca57a4eade23b5d5ee81e7477c7e5bb2948cd54725e0096d5b34194921aad1b56cb73e46301c
|
7
|
+
data.tar.gz: 41332d2498b1796f8d2a97f0e43da23cc30522681f001099ef63d3cc75892b97f2753682021e2594f86e008cfcf11bb17e6ff15a0122e11e25cb11f173e58661
|
data/CHANGELOG.md
CHANGED
@@ -1,24 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## 0.3.1 / 2023-01-19
|
4
|
+
|
5
|
+
- Revert removal of escaping/unescaping code in relative URL resolution (a78e83a)
|
6
|
+
|
7
|
+
## 0.3.0 / 2023-01-19
|
4
8
|
|
5
9
|
- Remove escaping/unescaping code in relative URL resolution (2de6c5b)
|
6
10
|
- Remove code-scanning-rubocop and rspec-github gems (3b3e625)
|
7
11
|
- Update development Ruby to v2.7.7 (bd328f5)
|
8
12
|
|
9
|
-
##
|
13
|
+
## 0.2.2 / 2022-08-20
|
10
14
|
|
11
15
|
- Improve handling of escaped and invalid URLs (b0d6c75)
|
12
16
|
|
13
|
-
##
|
17
|
+
## 0.2.1 / 2022-08-20
|
14
18
|
|
15
19
|
- Handle escaped URLs and invalid URLs (af78837)
|
16
20
|
- Use ruby/debug gem instead of pry-byebug (4476b9d)
|
17
21
|
|
18
|
-
##
|
22
|
+
## 0.2.0 / 2022-07-02
|
19
23
|
|
20
24
|
- Make `resolve_relative_url` method public (d132dd3)
|
21
25
|
|
22
|
-
##
|
26
|
+
## 0.1.0 / 2022-07-01
|
23
27
|
|
24
28
|
- Initial release! 🎉
|
@@ -69,9 +69,13 @@ module Nokogiri
|
|
69
69
|
#
|
70
70
|
# @return [String]
|
71
71
|
def resolve_relative_url(url)
|
72
|
-
|
73
|
-
|
74
|
-
|
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) })
|
76
|
+
.normalize
|
77
|
+
.to_s
|
78
|
+
)
|
75
79
|
rescue URI::InvalidComponentError, URI::InvalidURIError
|
76
80
|
url
|
77
81
|
end
|
@@ -106,6 +110,10 @@ module Nokogiri
|
|
106
110
|
end
|
107
111
|
end
|
108
112
|
end
|
113
|
+
|
114
|
+
def uri_parser
|
115
|
+
@uri_parser ||= URI::DEFAULT_PARSER
|
116
|
+
end
|
109
117
|
end
|
110
118
|
end
|
111
119
|
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.3.
|
4
|
+
version: 0.3.1
|
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.3.
|
47
|
+
changelog_uri: https://github.com/jgarber623/nokogiri-html-ext/blob/v0.3.1/CHANGELOG.md
|
48
48
|
rubygems_mfa_required: 'true'
|
49
49
|
post_install_message:
|
50
50
|
rdoc_options: []
|