html-proofer 3.18.0 → 3.18.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html-proofer/check/links.rb +10 -5
- data/lib/html-proofer/element.rb +4 -0
- data/lib/html-proofer/runner.rb +4 -3
- data/lib/html-proofer/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e90edda0dcb30f00baa440ec7b231bf73e086e0414fe9a1a56870940e2c15aeb
|
4
|
+
data.tar.gz: 2505df1fb597aaadfa68bf0f7c8b3d9380e27a236c31582d4c91840bf5e65623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5b864da4544723801ade7b906c387f893aed338ca36f9f3ae4a4660fa69f2f60883071cb2030cf526911abe954cf81932691a96c7c8f93e5e6970a18120449a
|
7
|
+
data.tar.gz: b141806119a645c1b974028f4e4ec3ecf60d74d51d1f5575d8b2fab4a3c7e90ddd8a6f8511474bd64825d49f591630ed8e9be83c1d5676b22b0f73b42ce93e3e
|
@@ -45,16 +45,21 @@ 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
|
52
52
|
next if @link.respond_to?(:rel) && @link.rel == 'dns-prefetch'
|
53
53
|
|
54
|
+
unless @link.path?
|
55
|
+
add_issue("#{@link.href} is an invalid URL", line: line, content: content)
|
56
|
+
next
|
57
|
+
end
|
58
|
+
|
54
59
|
add_to_external_urls(@link.href || @link.src)
|
55
60
|
next
|
56
61
|
elsif @link.internal?
|
57
|
-
if @link.exists?
|
62
|
+
if @link.exists? || @link.hash
|
58
63
|
add_to_internal_urls(@link.href, InternalLink.new(@link, @path, line, content))
|
59
64
|
else
|
60
65
|
add_issue("internally linking to #{@link.href}, which does not exist", line: line, content: content)
|
@@ -72,10 +77,10 @@ class LinkCheck < ::HTMLProofer::Check
|
|
72
77
|
return false
|
73
78
|
end
|
74
79
|
|
75
|
-
|
76
|
-
return handle_hash(link, path, line, content) if link.hash
|
80
|
+
return true unless link.hash
|
77
81
|
|
78
|
-
|
82
|
+
# verify the target hash
|
83
|
+
handle_hash(link, path, line, content)
|
79
84
|
end
|
80
85
|
|
81
86
|
def check_schemes(link, line, content)
|
data/lib/html-proofer/element.rb
CHANGED
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
|
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.18.
|
4
|
+
version: 3.18.5
|
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,9 +285,12 @@ 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
|
- - ">="
|