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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67354c8dbf65774b9c418bc69722ba7f97c9f852913784e9227c0bc9f9a5dff7
4
- data.tar.gz: f4ba45c896400d9dc5a8e5b84365f8b4238b456b01a4311ef962ff8353db6c8d
3
+ metadata.gz: 5b7b920edbff5d762b7c2da37c37b59ae2455e0d1991b74595856098749e4fce
4
+ data.tar.gz: 457aa965cba9c5a01802efd664b5accc08298691d9b05a0f5dcf8c05e9fb37f6
5
5
  SHA512:
6
- metadata.gz: d7b8edd22d5545c56e2564e255d87ac894691541efdb6e15e284b9194ea5078ac5b3a6b0cb477900491562884c56fe6246b371c8ad8def23c6a6bea92365bc32
7
- data.tar.gz: 6a5a6d1e19c1e1380012152b59a9a0baf68512c36a880b3810713edb98ea6830ef006ca67f03a0e15e98b813b8e23baed72d25c2a5b2b98d0d6c58460ca4e29c
6
+ metadata.gz: 80fa06b7ffbbce44179b2f44aa19f42d70eb82145d8c52fd2a3eca57a4eade23b5d5ee81e7477c7e5bb2948cd54725e0096d5b34194921aad1b56cb73e46301c
7
+ data.tar.gz: 41332d2498b1796f8d2a97f0e43da23cc30522681f001099ef63d3cc75892b97f2753682021e2594f86e008cfcf11bb17e6ff15a0122e11e25cb11f173e58661
data/CHANGELOG.md CHANGED
@@ -1,24 +1,28 @@
1
1
  # Changelog
2
2
 
3
- ## v0.3.0 / 2023-01-19
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
- ## v0.2.2 / 2022-08-20
13
+ ## 0.2.2 / 2022-08-20
10
14
 
11
15
  - Improve handling of escaped and invalid URLs (b0d6c75)
12
16
 
13
- ## v0.2.1 / 2022-08-20
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
- ## v0.2.0 / 2022-07-02
22
+ ## 0.2.0 / 2022-07-02
19
23
 
20
24
  - Make `resolve_relative_url` method public (d132dd3)
21
25
 
22
- ## v0.1.0 / 2022-07-01
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
- URI::DEFAULT_PARSER.join(*[document.url.strip, base_href, url.to_s].compact)
73
- .normalize
74
- .to_s
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nokogiri
4
4
  module HTMLExt
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  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.0
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.0/CHANGELOG.md
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: []