html-proofer 3.19.1 → 3.19.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e18991c07a3b31ae78293fc8dc2a9392211f8609ed494ed5cad87158747cde2
4
- data.tar.gz: d9551668e860b1055a640be9ba597cb9fca8822849a7b000d251086e8eadb023
3
+ metadata.gz: f27b5c50ae5c1c77d5fbe36dbbdca327bcb96302912b726f7f955f643d1dfc48
4
+ data.tar.gz: f09405cd0c70f1d2dc98f904c388bcab594f79107fdbe441c63f934821bef1b0
5
5
  SHA512:
6
- metadata.gz: 2e9187bcd157c8c69cb8dc7f47e9ef6908e7ccb06b56fd2fd241e8c3cbb245874a9776e5405c9aa5328a01e7038880f173d205efb2c925c7c5787e3c46d3389d
7
- data.tar.gz: 76afe0c48983344c1ebfb86075458d71b05163fb051ff0fbcbfa2104b324d520bbf7213ff262ec437d3ddeb6265d4454056d66a50d4c68ab02a3c6626a9633e0
6
+ metadata.gz: 53a8c98438f2056e7e2d926e926e10a6d0aa840b1b6f790860631912a2146dc20c68ca2b303d799a8fbfa723476e0e95dd5bc89695ceddf09ecede6f9acafbd1
7
+ data.tar.gz: f68269ba70facf5ede07452d1029f49d17baadff8c6b4fd1d9de520c0ede91ff360bacb0cf46b5c719c0ae35c50ad61c6ce5b36171867f6a1c9d8c675d805ebc
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`)'
@@ -89,7 +90,7 @@ Mercenary.program(:htmlproofer) do |p|
89
90
  options[:validation][:report_mismatched_tags] = opts['report_mismatched_tags'] unless opts['report_mismatched_tags'].nil?
90
91
 
91
92
  options[:typhoeus] = HTMLProofer::Configuration.parse_json_option('typhoeus_config', opts['typhoeus_config'], symbolize_names: false) unless opts['typhoeus_config'].nil?
92
- options[:hydra] = HTMLProofer::Configuration.parse_json_option('hydra_config', opts['hydra_config'], symbolize_names: false) unless opts['hydra_config'].nil?
93
+ options[:hydra] = HTMLProofer::Configuration.parse_json_option('hydra_config', opts['hydra_config']) unless opts['hydra_config'].nil?
93
94
 
94
95
  unless opts['timeframe'].nil?
95
96
  options[:cache] ||= {}
@@ -178,7 +178,7 @@ module HTMLProofer
178
178
  when :months
179
179
  @cache_datetime >> -measurement
180
180
  when :weeks
181
- @cache_datetime - measurement * 7
181
+ @cache_datetime - (measurement * 7)
182
182
  when :days
183
183
  @cache_datetime - measurement
184
184
  when :hours
@@ -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: {}
@@ -142,6 +142,10 @@ module HTMLProofer
142
142
  @check.options[:check_sri]
143
143
  end
144
144
 
145
+ def ignore_empty_mailto?
146
+ @check.options[:ignore_empty_mailto]
147
+ end
148
+
145
149
  # path is external to the file
146
150
  def external?
147
151
  !internal?
@@ -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.map { |url, file| [swap(url, @options[:url_swap]), file] }.to_h if @options[:url_swap]
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'nokogumbo'
3
+ require 'nokogiri'
4
4
 
5
5
  module HTMLProofer
6
6
  module Utils
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = '3.19.1'
4
+ VERSION = '3.19.4'
5
5
  end
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.19.1
4
+ version: 3.19.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: 2021-04-18 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: nokogumbo
42
+ name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '1.13'
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: '2.0'
54
+ version: '1.13'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: parallel
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
61
+ version: '1.10'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.3'
68
+ version: '1.10'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rainbow
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -278,7 +278,9 @@ files:
278
278
  homepage: https://github.com/gjtorikian/html-proofer
279
279
  licenses:
280
280
  - MIT
281
- metadata: {}
281
+ metadata:
282
+ funding_uri: https://github.com/sponsors/gjtorikian/
283
+ rubygems_mfa_required: 'true'
282
284
  post_install_message:
283
285
  rdoc_options: []
284
286
  require_paths:
@@ -287,7 +289,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
287
289
  requirements:
288
290
  - - ">="
289
291
  - !ruby/object:Gem::Version
290
- version: 2.4.10
292
+ version: 2.6.0
291
293
  - - "<"
292
294
  - !ruby/object:Gem::Version
293
295
  version: '4.0'
@@ -297,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
299
  - !ruby/object:Gem::Version
298
300
  version: '0'
299
301
  requirements: []
300
- rubygems_version: 3.1.4
302
+ rubygems_version: 3.3.13
301
303
  signing_key:
302
304
  specification_version: 4
303
305
  summary: A set of tests to validate your HTML output. These tests check if your image