html-proofer 3.18.8 → 3.19.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/htmlproofer +4 -1
- data/lib/html-proofer/cache.rb +1 -1
- data/lib/html-proofer/check/links.rb +1 -1
- data/lib/html-proofer/configuration.rb +3 -2
- data/lib/html-proofer/element.rb +4 -0
- data/lib/html-proofer/runner.rb +2 -1
- data/lib/html-proofer/utils.rb +1 -1
- data/lib/html-proofer/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2b4d8267ba11055f2b4d9da7b9367dfddca14c9438bb50d1e501fc5f554ae78
|
4
|
+
data.tar.gz: 0cac83b1b517f551bcc92c29da4fbecf6af3c75a5968651e4a89b11600959ce9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97b53efb1b177d460ff721a2558b582c89a616eae171212056979fc03a2f95ee21ecc887865794580830c42d3ad73b4ab32fc9c99d442edea429f38f810baab5
|
7
|
+
data.tar.gz: e9c005e2def8641531efc6c8e64f69eb980c0ce8bdf096dd13e93856546c9ab97f205c27bf20b709e741f1053a13b8f34b1325cb35dd9db7af44eb56635fca27
|
data/bin/htmlproofer
CHANGED
@@ -37,6 +37,7 @@ Mercenary.program(:htmlproofer) do |p|
|
|
37
37
|
p.option 'file_ignore', '--file-ignore file1,[file2,...]', Array, 'A comma-separated list of Strings or RegExps containing file paths that are safe to ignore'
|
38
38
|
p.option 'http_status_ignore', '--http-status-ignore 123,[xxx, ...]', Array, 'A comma-separated list of numbers representing status codes to ignore.'
|
39
39
|
p.option 'internal_domains', '--internal-domains domain1,[domain2,...]', Array, 'A comma-separated list of Strings containing domains that will be treated as internal urls.'
|
40
|
+
p.option 'ignore_empty_mailto', '--ignore-empty-mailto', 'If `true`, allows `mailto:` `href`s which do not contain an email address'
|
40
41
|
p.option 'report_invalid_tags', '--report-invalid-tags', 'When `check_html` is enabled, HTML markup that is unknown to Nokogumbo are reported as errors (default: `false`)'
|
41
42
|
p.option 'report_missing_names', '--report-missing-names', 'When `check_html` is enabled, HTML markup that are missing entity names are reported as errors (default: `false`)'
|
42
43
|
p.option 'report_script_embeds', '--report-script-embeds', 'When `check_html` is enabled, `script` tags containing markup are reported as errors (default: `false`)'
|
@@ -48,6 +49,7 @@ Mercenary.program(:htmlproofer) do |p|
|
|
48
49
|
p.option 'storage_dir', '--storage-dir PATH', String, 'Directory where to store the cache log (default: "tmp/.htmlproofer")'
|
49
50
|
p.option 'timeframe', '--timeframe <time>', String, 'A string representing the caching timeframe.'
|
50
51
|
p.option 'typhoeus_config', '--typhoeus-config CONFIG', String, 'JSON-formatted string of Typhoeus config. Will override the html-proofer defaults.'
|
52
|
+
p.option 'hydra_config', '--hydra-config CONFIG', String, 'JSON-formatted string of Hydra config. Will override the html-proofer defaults.'
|
51
53
|
p.option 'url_ignore', '--url-ignore link1,[link2,...]', Array, 'A comma-separated list of Strings or RegExps containing URLs that are safe to ignore. It affects all HTML attributes. Note that non-HTTP(S) URIs are always ignored'
|
52
54
|
p.option 'url_swap', '--url-swap re:string,[re:string,...]', Array, 'A comma-separated list containing key-value pairs of `RegExp => String`. It transforms URLs that match `RegExp` into `String` via `gsub`. The escape sequences `\\:` should be used to produce literal `:`s.'
|
53
55
|
p.option 'root_dir', '--root-dir PATH', String, 'The absolute path to the directory serving your html-files.'
|
@@ -87,7 +89,8 @@ Mercenary.program(:htmlproofer) do |p|
|
|
87
89
|
options[:validation][:report_eof_tags] = opts['report_eof_tags'] unless opts['report_eof_tags'].nil?
|
88
90
|
options[:validation][:report_mismatched_tags] = opts['report_mismatched_tags'] unless opts['report_mismatched_tags'].nil?
|
89
91
|
|
90
|
-
options[:typhoeus] = HTMLProofer::Configuration.parse_json_option('typhoeus_config', opts['typhoeus_config']) unless opts['typhoeus_config'].nil?
|
92
|
+
options[:typhoeus] = HTMLProofer::Configuration.parse_json_option('typhoeus_config', opts['typhoeus_config'], symbolize_names: false) unless opts['typhoeus_config'].nil?
|
93
|
+
options[:hydra] = HTMLProofer::Configuration.parse_json_option('hydra_config', opts['hydra_config']) unless opts['hydra_config'].nil?
|
91
94
|
|
92
95
|
unless opts['timeframe'].nil?
|
93
96
|
options[:cache] ||= {}
|
data/lib/html-proofer/cache.rb
CHANGED
@@ -95,7 +95,7 @@ class LinkCheck < ::HTMLProofer::Check
|
|
95
95
|
|
96
96
|
def handle_mailto(link, line, content)
|
97
97
|
if link.path.empty?
|
98
|
-
add_issue("#{link.href} contains no email address", line: line, content: content)
|
98
|
+
add_issue("#{link.href} contains no email address", line: line, content: content) unless link.ignore_empty_mailto?
|
99
99
|
elsif !link.path.include?('@')
|
100
100
|
add_issue("#{link.href} contains an invalid email address", line: line, content: content)
|
101
101
|
end
|
@@ -27,6 +27,7 @@ module HTMLProofer
|
|
27
27
|
http_status_ignore: [],
|
28
28
|
internal_domains: [],
|
29
29
|
log_level: :info,
|
30
|
+
ignore_empty_mailto: false,
|
30
31
|
only_4xx: false,
|
31
32
|
url_ignore: [],
|
32
33
|
url_swap: {}
|
@@ -67,7 +68,7 @@ module HTMLProofer
|
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
70
|
-
def self.parse_json_option(option_name, config)
|
71
|
+
def self.parse_json_option(option_name, config, symbolize_names: true)
|
71
72
|
raise ArgumentError, 'Must provide an option name in string format.' unless option_name.is_a?(String)
|
72
73
|
raise ArgumentError, 'Must provide an option name in string format.' if option_name.strip.empty?
|
73
74
|
|
@@ -78,7 +79,7 @@ module HTMLProofer
|
|
78
79
|
return {} if config.strip.empty?
|
79
80
|
|
80
81
|
begin
|
81
|
-
JSON.parse(config)
|
82
|
+
JSON.parse(config, { symbolize_names: symbolize_names })
|
82
83
|
rescue StandardError
|
83
84
|
raise ArgumentError, "Option '#{option_name} did not contain valid JSON."
|
84
85
|
end
|
data/lib/html-proofer/element.rb
CHANGED
data/lib/html-proofer/runner.rb
CHANGED
@@ -53,6 +53,7 @@ module HTMLProofer
|
|
53
53
|
if @failures.empty?
|
54
54
|
@logger.log :info, 'HTML-Proofer finished successfully.'
|
55
55
|
else
|
56
|
+
@failures.uniq!
|
56
57
|
print_failed_tests
|
57
58
|
end
|
58
59
|
end
|
@@ -125,7 +126,7 @@ module HTMLProofer
|
|
125
126
|
end
|
126
127
|
|
127
128
|
external_urls = check.external_urls
|
128
|
-
external_urls = check.external_urls.
|
129
|
+
external_urls = check.external_urls.transform_keys { |url| swap(url, @options[:url_swap]) } if @options[:url_swap]
|
129
130
|
result[:external_urls].merge!(external_urls)
|
130
131
|
result[:failures].concat(check.issues)
|
131
132
|
end
|
data/lib/html-proofer/utils.rb
CHANGED
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.19.3
|
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-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.12'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.12'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: parallel
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -287,7 +287,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
287
287
|
requirements:
|
288
288
|
- - ">="
|
289
289
|
- !ruby/object:Gem::Version
|
290
|
-
version: 2.
|
290
|
+
version: 2.6.0
|
291
291
|
- - "<"
|
292
292
|
- !ruby/object:Gem::Version
|
293
293
|
version: '4.0'
|
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
297
297
|
- !ruby/object:Gem::Version
|
298
298
|
version: '0'
|
299
299
|
requirements: []
|
300
|
-
rubygems_version: 3.
|
300
|
+
rubygems_version: 3.2.33
|
301
301
|
signing_key:
|
302
302
|
specification_version: 4
|
303
303
|
summary: A set of tests to validate your HTML output. These tests check if your image
|