html-proofer 3.7.0 → 3.7.1
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/check/scripts.rb +3 -3
- data/lib/html-proofer/element.rb +21 -5
- data/lib/html-proofer/runner.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e2e987f27cea394b1d6fd60937e45e32addbd15
|
4
|
+
data.tar.gz: 894dba51116323f95f00720d9317c75e00be75fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27cb87adf3a63d61e020d55418d2bb33983e1b50a709d3251caf5e66850ea694f812e51eaaff2ec08a3cdff081c6a2ad18fa6db402b90d36fa4507815c552274
|
7
|
+
data.tar.gz: 1a126cc3aabbd152d8afac93b3b1a4133498b95d6218aeb1885142623f324628dfd367f3b4919deeefb7ca093ab2d605f09273ed7089b5aac58a51321dcdb40b
|
@@ -29,11 +29,11 @@ class ScriptCheck < ::HTMLProofer::Check
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def check_sri(line, content)
|
32
|
-
if !defined?
|
32
|
+
if !defined?(@script.integrity) && !defined?(@script.crossorigin)
|
33
33
|
add_issue("SRI and CORS not provided in: #{@script.src}", line: line, content: content)
|
34
|
-
elsif !defined?
|
34
|
+
elsif !defined?(@script.integrity)
|
35
35
|
add_issue("Integrity is missing in: #{@script.src}", line: line, content: content)
|
36
|
-
elsif !defined?
|
36
|
+
elsif !defined?(@script.crossorigin)
|
37
37
|
add_issue("CORS not provided for external resource in: #{@script.src}", line: line, content: content)
|
38
38
|
end
|
39
39
|
end
|
data/lib/html-proofer/element.rb
CHANGED
@@ -16,7 +16,9 @@ module HTMLProofer
|
|
16
16
|
instance_variable_set("@#{name}", value.value)
|
17
17
|
end
|
18
18
|
|
19
|
-
@aria_hidden = @aria_hidden == 'true' ? true : false
|
19
|
+
@aria_hidden = (defined?(@aria_hidden) && @aria_hidden == 'true') ? true : false
|
20
|
+
|
21
|
+
@data_proofer_ignore = defined?(@data_proofer_ignore)
|
20
22
|
|
21
23
|
@text = obj.content
|
22
24
|
@check = check
|
@@ -31,9 +33,23 @@ module HTMLProofer
|
|
31
33
|
@parent_ignorable = parent_attributes.any? { |a| !a['data-proofer-ignore'].nil? }
|
32
34
|
|
33
35
|
# fix up missing protocols
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
if defined?(@href)
|
37
|
+
@href.insert(0, 'http:') if @href =~ %r{^//}
|
38
|
+
else
|
39
|
+
@href = nil
|
40
|
+
end
|
41
|
+
|
42
|
+
if defined?(@src)
|
43
|
+
@src.insert(0, 'http:') if @src =~ %r{^//}
|
44
|
+
else
|
45
|
+
@src = nil
|
46
|
+
end
|
47
|
+
|
48
|
+
if defined?(@srcset)
|
49
|
+
@srcset.insert(0, 'http:') if @srcset =~ %r{^//}
|
50
|
+
else
|
51
|
+
@srcset = nil
|
52
|
+
end
|
37
53
|
end
|
38
54
|
|
39
55
|
def url
|
@@ -50,7 +66,7 @@ module HTMLProofer
|
|
50
66
|
|
51
67
|
def parts
|
52
68
|
@parts ||= Addressable::URI.parse url
|
53
|
-
rescue URI::Error, Addressable::URI::InvalidURIError
|
69
|
+
rescue URI::Error, Addressable::URI::InvalidURIError
|
54
70
|
@parts = nil
|
55
71
|
end
|
56
72
|
|
data/lib/html-proofer/runner.rb
CHANGED
@@ -142,7 +142,7 @@ module HTMLProofer
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def checks
|
145
|
-
return @checks
|
145
|
+
return @checks if defined?(@checks) && !@checks.nil?
|
146
146
|
@checks = HTMLProofer::Check.subchecks.map(&:name)
|
147
147
|
@checks.delete('FaviconCheck') unless @options[:check_favicon]
|
148
148
|
@checks.delete('HtmlCheck') unless @options[:check_html]
|
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.7.
|
4
|
+
version: 3.7.1
|
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-
|
11
|
+
date: 2017-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|