html-proofer 3.19.2 → 3.19.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d06dbda8bf9baad3be96b5565fcb86de0892d4241c6b7ede08c3c2d7203f6752
4
- data.tar.gz: da895d696b7b9d1f3ca9c2e504e0c375ce9942f53dd5c2174f80570d32e3ad5b
3
+ metadata.gz: c2b4d8267ba11055f2b4d9da7b9367dfddca14c9438bb50d1e501fc5f554ae78
4
+ data.tar.gz: 0cac83b1b517f551bcc92c29da4fbecf6af3c75a5968651e4a89b11600959ce9
5
5
  SHA512:
6
- metadata.gz: 693f677cb91b9b0e79135ef27ed2771d34d7e5fee5bd368b20b5791a4e25a468ba769d299c2cd1417eccd989d9ac1290cfaf9dfd90b9534fa0af0440382e4e0f
7
- data.tar.gz: c6c33f309e3f8b00dc1721653f2e2099c647c9bd8d3b4ecaab4ec7b97161925911d1e6e3c8cabb30b9b9eb2274fed7238ed338da7d85d25b7c6981d537f6435d
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`)'
@@ -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
@@ -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.2'
4
+ VERSION = '3.19.3'
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.2
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-06-24 00:00:00.000000000 Z
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: 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.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: '2.0'
54
+ version: '1.12'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: parallel
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -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.1.4
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