html-proofer 3.18.5 → 3.18.6
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/cache.rb +6 -1
- data/lib/html-proofer/check/links.rb +2 -5
- data/lib/html-proofer/element.rb +3 -1
- data/lib/html-proofer/middleware.rb +1 -1
- data/lib/html-proofer/runner.rb +4 -2
- data/lib/html-proofer/url_validator.rb +1 -1
- data/lib/html-proofer/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: e2d6deb85601ff3f5e5df02999f1b55f29231e5658f1d4fa9986c002b3cc0263
|
4
|
+
data.tar.gz: e20a007144a866b41b97eb36a964ca1372d693ade77acc69a9c9e706b353c8ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c51154450eb20c04c0b7038effb12ab8d258457ea5560421b5a2a0739342504afebb8fd092fe4378838a076636ff2665eb691f513b8b34b49af2e89ffba988c2
|
7
|
+
data.tar.gz: fcb7bf492588fabc991caf1f779fca14a7b553d3ce00dbf55ba24aebf3c39f7613af6a408d94c3a3faaeb21dceb8265ece91ca9bf4320aee7d4f3dca133ba4de
|
data/lib/html-proofer/cache.rb
CHANGED
@@ -109,8 +109,13 @@ module HTMLProofer
|
|
109
109
|
additions
|
110
110
|
end
|
111
111
|
|
112
|
+
# TODO: Garbage performance--both the external and internal
|
113
|
+
# caches need access to this file. Write a proper versioned
|
114
|
+
# schema in the future
|
112
115
|
def write
|
113
|
-
|
116
|
+
file = {}
|
117
|
+
file = JSON.parse(File.read(cache_file)) if File.exist?(cache_file)
|
118
|
+
File.write(cache_file, file.merge(@cache_log).to_json)
|
114
119
|
end
|
115
120
|
|
116
121
|
def load?
|
@@ -59,11 +59,8 @@ class LinkCheck < ::HTMLProofer::Check
|
|
59
59
|
add_to_external_urls(@link.href || @link.src)
|
60
60
|
next
|
61
61
|
elsif @link.internal?
|
62
|
-
|
63
|
-
|
64
|
-
else
|
65
|
-
add_issue("internally linking to #{@link.href}, which does not exist", line: line, content: content)
|
66
|
-
end
|
62
|
+
add_to_internal_urls(@link.href, InternalLink.new(@link, @path, line, content))
|
63
|
+
add_issue("internally linking to #{@link.href}, which does not exist", line: line, content: content) if !@link.exists? && !@link.hash
|
67
64
|
end
|
68
65
|
end
|
69
66
|
|
data/lib/html-proofer/element.rb
CHANGED
@@ -24,7 +24,7 @@ module HTMLProofer
|
|
24
24
|
raise e
|
25
25
|
end
|
26
26
|
|
27
|
-
@aria_hidden = defined?(@aria_hidden) && @aria_hidden == 'true'
|
27
|
+
@aria_hidden = defined?(@aria_hidden) && @aria_hidden == 'true'
|
28
28
|
|
29
29
|
@data_proofer_ignore = defined?(@data_proofer_ignore)
|
30
30
|
|
@@ -220,6 +220,8 @@ module HTMLProofer
|
|
220
220
|
end
|
221
221
|
|
222
222
|
def ignores_pattern_check(links)
|
223
|
+
return false unless links.is_a?(Array)
|
224
|
+
|
223
225
|
links.each do |ignore|
|
224
226
|
case ignore
|
225
227
|
when String
|
@@ -22,7 +22,7 @@ module HTMLProofer
|
|
22
22
|
allow_hash_href: true,
|
23
23
|
check_external_hash: true,
|
24
24
|
check_html: true,
|
25
|
-
url_ignore: [
|
25
|
+
url_ignore: [%r{^/}], # Don't try to check if local files exist
|
26
26
|
validation: { report_eof_tags: true }
|
27
27
|
}
|
28
28
|
end
|
data/lib/html-proofer/runner.rb
CHANGED
@@ -63,7 +63,9 @@ module HTMLProofer
|
|
63
63
|
swap(url, @options[:url_swap])
|
64
64
|
end
|
65
65
|
end
|
66
|
-
@external_urls =
|
66
|
+
@external_urls = @src.each_with_object({}) do |url, hash|
|
67
|
+
hash[url] = nil
|
68
|
+
end
|
67
69
|
validate_external_urls
|
68
70
|
end
|
69
71
|
|
@@ -123,7 +125,7 @@ module HTMLProofer
|
|
123
125
|
end
|
124
126
|
|
125
127
|
external_urls = check.external_urls
|
126
|
-
external_urls =
|
128
|
+
external_urls = check.external_urls.map { |url, file| [swap(url, @options[:url_swap]), file] }.to_h if @options[:url_swap]
|
127
129
|
result[:external_urls].merge!(external_urls)
|
128
130
|
result[:failures].concat(check.issues)
|
129
131
|
end
|
@@ -85,7 +85,7 @@ module HTMLProofer
|
|
85
85
|
# for HEAD. If we've decided to check for hashes, we must do a GET--HEAD is
|
86
86
|
# not available as an option.
|
87
87
|
def external_link_checker(external_urls)
|
88
|
-
external_urls =
|
88
|
+
external_urls = external_urls.sort.to_h
|
89
89
|
|
90
90
|
count = external_urls.length
|
91
91
|
check_text = pluralize(count, 'external link', 'external links')
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|