nokogiri-html-ext 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +2 -2
- data/lib/nokogiri/html_ext/document.rb +4 -18
- data/lib/nokogiri/html_ext/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67354c8dbf65774b9c418bc69722ba7f97c9f852913784e9227c0bc9f9a5dff7
|
4
|
+
data.tar.gz: f4ba45c896400d9dc5a8e5b84365f8b4238b456b01a4311ef962ff8353db6c8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7b8edd22d5545c56e2564e255d87ac894691541efdb6e15e284b9194ea5078ac5b3a6b0cb477900491562884c56fe6246b371c8ad8def23c6a6bea92365bc32
|
7
|
+
data.tar.gz: 6a5a6d1e19c1e1380012152b59a9a0baf68512c36a880b3810713edb98ea6830ef006ca67f03a0e15e98b813b8e23baed72d25c2a5b2b98d0d6c58460ca4e29c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.3.0 / 2023-01-19
|
4
|
+
|
5
|
+
- Remove escaping/unescaping code in relative URL resolution (2de6c5b)
|
6
|
+
- Remove code-scanning-rubocop and rspec-github gems (3b3e625)
|
7
|
+
- Update development Ruby to v2.7.7 (bd328f5)
|
8
|
+
|
9
|
+
## v0.2.2 / 2022-08-20
|
10
|
+
|
11
|
+
- Improve handling of escaped and invalid URLs (b0d6c75)
|
12
|
+
|
3
13
|
## v0.2.1 / 2022-08-20
|
4
14
|
|
5
15
|
- Handle escaped URLs and invalid URLs (af78837)
|
data/CONTRIBUTING.md
CHANGED
@@ -8,9 +8,9 @@ There are a couple ways you can help improve nokogiri-html-ext:
|
|
8
8
|
|
9
9
|
## Getting Started
|
10
10
|
|
11
|
-
nokogiri-html-ext is developed using Ruby 2.7.
|
11
|
+
nokogiri-html-ext is developed using Ruby 2.7.7 and is additionally tested against Ruby 3.0, 3.1, and 3.2 using [GitHub Actions](https://github.com/jgarber623/nokogiri-html-ext/actions).
|
12
12
|
|
13
|
-
Before making changes to nokogiri-html-ext, you'll want to install Ruby 2.7.
|
13
|
+
Before making changes to nokogiri-html-ext, you'll want to install Ruby 2.7.7. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.7.7 using your method of choice, install the project's gems by running:
|
14
14
|
|
15
15
|
```sh
|
16
16
|
bundle install
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
[](https://rubygems.org/gems/nokogiri-html-ext)
|
6
6
|
[](https://rubygems.org/gems/nokogiri-html-ext)
|
7
|
-
[](https://github.com/jgarber623/nokogiri-html-ext/actions/workflows/ci.yml)
|
8
8
|
[](https://codeclimate.com/github/jgarber623/nokogiri-html-ext)
|
9
9
|
[](https://codeclimate.com/github/jgarber623/nokogiri-html-ext/code)
|
10
10
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
Before installing and using nokogiri-html-ext, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
|
20
20
|
|
21
|
-
nokogiri-html-ext is developed using Ruby 2.7.
|
21
|
+
nokogiri-html-ext is developed using Ruby 2.7.7 and is additionally tested against Ruby 3.0, 3.1, and 3.2 using [GitHub Actions](https://github.com/jgarber623/nokogiri-html-ext/actions).
|
22
22
|
|
23
23
|
## Installation
|
24
24
|
|
@@ -69,13 +69,11 @@ module Nokogiri
|
|
69
69
|
#
|
70
70
|
# @return [String]
|
71
71
|
def resolve_relative_url(url)
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
.to_s
|
76
|
-
)
|
72
|
+
URI::DEFAULT_PARSER.join(*[document.url.strip, base_href, url.to_s].compact)
|
73
|
+
.normalize
|
74
|
+
.to_s
|
77
75
|
rescue URI::InvalidComponentError, URI::InvalidURIError
|
78
|
-
|
76
|
+
url
|
79
77
|
end
|
80
78
|
|
81
79
|
# Convert the document's relative URLs to absolute URLs.
|
@@ -99,10 +97,6 @@ module Nokogiri
|
|
99
97
|
|
100
98
|
private
|
101
99
|
|
102
|
-
def escape(url)
|
103
|
-
uri_parser.escape(url.to_s)
|
104
|
-
end
|
105
|
-
|
106
100
|
def resolve_relative_urls_for(attributes_map)
|
107
101
|
attributes_map.each do |attribute, names|
|
108
102
|
xpaths = names.map { |name| "//#{name}[@#{attribute}]" }
|
@@ -112,14 +106,6 @@ module Nokogiri
|
|
112
106
|
end
|
113
107
|
end
|
114
108
|
end
|
115
|
-
|
116
|
-
def unescape(url)
|
117
|
-
uri_parser.unescape(url.to_s)
|
118
|
-
end
|
119
|
-
|
120
|
-
def uri_parser
|
121
|
-
@uri_parser ||= URI::DEFAULT_PARSER
|
122
|
-
end
|
123
109
|
end
|
124
110
|
end
|
125
111
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri-html-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -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.
|
47
|
+
changelog_uri: https://github.com/jgarber623/nokogiri-html-ext/blob/v0.3.0/CHANGELOG.md
|
48
48
|
rubygems_mfa_required: 'true'
|
49
49
|
post_install_message:
|
50
50
|
rdoc_options: []
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
|
-
rubygems_version: 3.3.
|
64
|
+
rubygems_version: 3.3.26
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: Extend Nokogiri with several useful HTML-centric features.
|