html-proofer 3.7.2 → 3.7.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
  SHA1:
3
- metadata.gz: deb1da1ed4ae6e0e0641fae514b0cbd2da643487
4
- data.tar.gz: 24d179721b6ceb6e913a39228edc4e751c225d2b
3
+ metadata.gz: 301f92856184797608bb768aad054c717bb349ff
4
+ data.tar.gz: f4e2a2c8c4e8267dc2f287bd411e53f95d9454ba
5
5
  SHA512:
6
- metadata.gz: 28017e3ec9e9a91ed0aa56821a6ecfc940fa1ee36dc3323a06f559b2b38c65b9670e4484b4decdc8f7bcf0c38c6574524f40a17a3290a923565c21d93c4a65b5
7
- data.tar.gz: f505b3e0e951f6b407f9f77567e89f78533885a3d2ce0defd839c02690e24b1b26cea2a5424753675d8439c3e5144aed477d508d9b075f53c546fd5f91e3119b
6
+ metadata.gz: 4a11c32e6aba302074bef75174ac36921273c6e69173fe66a419035b2fc37610b8a8351dfabfc0e7830a3081b1e004529c5cffaefb9e8cde5d574b74f8481ef6
7
+ data.tar.gz: 4cc636be64d8a4646c6305cfd9885a4d0d249bf062bbd739efa9af6fe230c4d57a994c071e9f17120416957bebc3453d7d566ddec001305e5d457ff535546402
@@ -10,6 +10,16 @@ class FaviconCheck < ::HTMLProofer::Check
10
10
 
11
11
  return if found
12
12
 
13
+ return if is_immediate_redirect?
14
+
13
15
  add_issue('no favicon specified')
14
16
  end
17
+
18
+ private
19
+
20
+ def is_immediate_redirect?
21
+ # allow any instant-redirect meta tag
22
+ @html.xpath("//meta[@http-equiv='refresh']").attribute('content').value.starts_with? '0;' rescue false
23
+ end
24
+
15
25
  end
@@ -2,7 +2,7 @@ class ImageCheck < ::HTMLProofer::Check
2
2
  SCREEN_SHOT_REGEX = /Screen(?: |%20)Shot(?: |%20)\d+-\d+-\d+(?: |%20)at(?: |%20)\d+.\d+.\d+/
3
3
 
4
4
  def empty_alt_tag?
5
- @img.alt.strip.empty?
5
+ @img.alt.nil? || @img.alt.strip.empty?
6
6
  end
7
7
 
8
8
  def terrible_filename?
@@ -36,7 +36,7 @@ class ImageCheck < ::HTMLProofer::Check
36
36
  add_issue("internal image #{@img.url} does not exist", line: line, content: content)
37
37
  end
38
38
 
39
- if !@img.ignore_alt? && (@img.alt.nil? || (empty_alt_tag? && !@img.ignore_empty_alt?))
39
+ if empty_alt_tag? && !@img.ignore_empty_alt? && !@img.ignore_alt?
40
40
  add_issue("image #{@img.url} does not have an alt attribute", line: line, content: content)
41
41
  end
42
42
 
@@ -40,7 +40,7 @@ class LinkCheck < ::HTMLProofer::Check
40
40
  next if @link.non_http_remote?
41
41
 
42
42
  if !@link.internal? && @link.remote?
43
- check_sri(line, content) if @link.check_sri?
43
+ check_sri(line, content) if @link.check_sri? && node.name == 'link'
44
44
  # we need to skip these for now; although the domain main be valid,
45
45
  # curl/Typheous inaccurately return 404s for some links. cc https://git.io/vyCFx
46
46
  next if @link.try(:rel) == 'dns-prefetch'
@@ -32,7 +32,8 @@ module HTMLProofer
32
32
  TYPHOEUS_DEFAULTS = {
33
33
  followlocation: true,
34
34
  headers: {
35
- 'User-Agent' => "Mozilla/5.0 (compatible; HTML Proofer/#{HTMLProofer::VERSION}; +https://github.com/gjtorikian/html-proofer)"
35
+ 'User-Agent' => "Mozilla/5.0 (compatible; HTML Proofer/#{HTMLProofer::VERSION}; +https://github.com/gjtorikian/html-proofer)",
36
+ 'Accept' => 'application/xml,application/xhtml+xml,text/html;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5'
36
37
  },
37
38
  connecttimeout: 10,
38
39
  timeout: 30
@@ -1,5 +1,5 @@
1
1
  require 'yell'
2
- require 'colored'
2
+ require 'colorized_string'
3
3
 
4
4
  module HTMLProofer
5
5
  class Log
@@ -35,7 +35,7 @@ module HTMLProofer
35
35
 
36
36
  def colorize(color, message)
37
37
  if $stdout.isatty && $stderr.isatty
38
- Colored.colorize(message, foreground: color)
38
+ ColorizedString.new(message).colorize(color)
39
39
  else
40
40
  message
41
41
  end
@@ -36,7 +36,7 @@ module HTMLProofer
36
36
  return nil if @external_urls.nil?
37
37
  paths_with_queries = {}
38
38
  iterable_external_urls = @external_urls.dup
39
- @external_urls.keys.each do |url|
39
+ @external_urls.each_key do |url|
40
40
  uri = begin
41
41
  Addressable::URI.parse(url)
42
42
  rescue URI::Error, Addressable::URI::InvalidURIError
@@ -1,3 +1,3 @@
1
1
  module HTMLProofer
2
- VERSION = '3.7.2'.freeze
2
+ VERSION = '3.7.3'.freeze
3
3
  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.7.2
4
+ version: 3.7.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: 2017-05-21 00:00:00.000000000 Z
11
+ date: 2017-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
- name: colored
42
+ name: colorize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.2'
47
+ version: '0.8'
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: '1.2'
54
+ version: '0.8'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: typhoeus
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -170,6 +170,20 @@ dependencies:
170
170
  - - ">="
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: codecov
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
173
187
  - !ruby/object:Gem::Dependency
174
188
  name: rspec
175
189
  requirement: !ruby/object:Gem::Requirement