html-proofer 3.17.4 → 3.18.4
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/lib/html-proofer.rb +2 -0
- data/lib/html-proofer/check/links.rb +5 -5
- data/lib/html-proofer/runner.rb +6 -4
- data/lib/html-proofer/url_validator.rb +1 -1
- data/lib/html-proofer/version.rb +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8232203ce195b44adb3f672b9e132b75c81cfaad59dc8340e35c7f6183b8eb41
|
4
|
+
data.tar.gz: 9ef4b713c060de1a91781725e0771842d8dd9a716a172ef23fa140929f12b8fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ec514672b80820d78e56a9773cb4dd6952f84ad8556b6271e1b64307b80c3c07c952ef9eea0c9fb87a4d578757e6c6c1dbac232265ac7f11301169fceb63da2
|
7
|
+
data.tar.gz: d25e811c505fdc3f940b4646eb916db8d64de32ab03b7be707c5fa4e7fd94080722dc2e3147a257d2714cfaf83a9acc4abb9b636bb0400a409d41538842c72bc
|
data/lib/html-proofer.rb
CHANGED
@@ -45,7 +45,7 @@ class LinkCheck < ::HTMLProofer::Check
|
|
45
45
|
# intentionally here because we still want valid? & missing_href? to execute
|
46
46
|
next if @link.non_http_remote?
|
47
47
|
|
48
|
-
if !@link.internal? && @link.remote?
|
48
|
+
if !@link.href&.start_with?('#') && !@link.internal? && @link.remote?
|
49
49
|
check_sri(line, content) if @link.check_sri? && node.name == 'link'
|
50
50
|
# we need to skip these for now; although the domain main be valid,
|
51
51
|
# curl/Typheous inaccurately return 404s for some links. cc https://git.io/vyCFx
|
@@ -54,7 +54,7 @@ class LinkCheck < ::HTMLProofer::Check
|
|
54
54
|
add_to_external_urls(@link.href || @link.src)
|
55
55
|
next
|
56
56
|
elsif @link.internal?
|
57
|
-
if @link.exists?
|
57
|
+
if @link.exists? || @link.hash
|
58
58
|
add_to_internal_urls(@link.href, InternalLink.new(@link, @path, line, content))
|
59
59
|
else
|
60
60
|
add_issue("internally linking to #{@link.href}, which does not exist", line: line, content: content)
|
@@ -72,10 +72,10 @@ class LinkCheck < ::HTMLProofer::Check
|
|
72
72
|
return false
|
73
73
|
end
|
74
74
|
|
75
|
-
|
76
|
-
return handle_hash(link, path, line, content) if link.hash
|
75
|
+
return true unless link.hash
|
77
76
|
|
78
|
-
|
77
|
+
# verify the target hash
|
78
|
+
handle_hash(link, path, line, content)
|
79
79
|
end
|
80
80
|
|
81
81
|
def check_schemes(link, line, content)
|
data/lib/html-proofer/runner.rb
CHANGED
@@ -157,11 +157,12 @@ module HTMLProofer
|
|
157
157
|
@cache.write
|
158
158
|
else
|
159
159
|
@internal_urls.values.flatten.each do |internal_url|
|
160
|
-
@internal_link_checks.check_internal_link(internal_url.link, internal_url.path, internal_url.line, internal_url.content)
|
160
|
+
result = @internal_link_checks.check_internal_link(internal_url.link, internal_url.path, internal_url.line, internal_url.content)
|
161
|
+
next if result
|
162
|
+
|
163
|
+
@failures.concat(@internal_link_checks.issues) unless @internal_link_checks.issues.length.zero?
|
161
164
|
end
|
162
165
|
end
|
163
|
-
|
164
|
-
@failures.concat(@internal_link_checks.issues) unless @internal_urls.length.zero?
|
165
166
|
end
|
166
167
|
|
167
168
|
def files
|
@@ -214,7 +215,8 @@ module HTMLProofer
|
|
214
215
|
sorted_failures.sort_and_report
|
215
216
|
count = @failures.length
|
216
217
|
failure_text = pluralize(count, 'failure', 'failures')
|
217
|
-
|
218
|
+
@logger.log :fatal, "\nHTML-Proofer found #{failure_text}!"
|
219
|
+
exit 1
|
218
220
|
end
|
219
221
|
|
220
222
|
# Set before_request callback.
|
@@ -120,7 +120,7 @@ module HTMLProofer
|
|
120
120
|
def clean_url(href)
|
121
121
|
# catch any obvious issues, like strings in port numbers
|
122
122
|
parsed = Addressable::URI.parse(href)
|
123
|
-
if href =~ /^([!#{
|
123
|
+
if href =~ /^([!#{Regexp.last_match(0)}-;=?-\[\]_a-z~]|%[0-9a-fA-F]{2})+$/
|
124
124
|
href
|
125
125
|
else
|
126
126
|
parsed.normalize
|
data/lib/html-proofer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html-proofer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.18.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -285,16 +285,19 @@ require_paths:
|
|
285
285
|
- lib
|
286
286
|
required_ruby_version: !ruby/object:Gem::Requirement
|
287
287
|
requirements:
|
288
|
-
- - "
|
288
|
+
- - ">="
|
289
|
+
- !ruby/object:Gem::Version
|
290
|
+
version: 2.4.10
|
291
|
+
- - "<"
|
289
292
|
- !ruby/object:Gem::Version
|
290
|
-
version: '
|
293
|
+
version: '4.0'
|
291
294
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
292
295
|
requirements:
|
293
296
|
- - ">="
|
294
297
|
- !ruby/object:Gem::Version
|
295
298
|
version: '0'
|
296
299
|
requirements: []
|
297
|
-
rubygems_version: 3.1.
|
300
|
+
rubygems_version: 3.1.4
|
298
301
|
signing_key:
|
299
302
|
specification_version: 4
|
300
303
|
summary: A set of tests to validate your HTML output. These tests check if your image
|