html-proofer 5.0.9 → 5.0.10
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 +4 -4
- data/lib/html_proofer/attribute/url.rb +1 -1
- data/lib/html_proofer/check/images.rb +12 -12
- data/lib/html_proofer/log.rb +1 -1
- data/lib/html_proofer/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ecfce010632739b71710eb8b6c91b8ca6ca4828e2b6e7df254c2cc6b00462a4
|
4
|
+
data.tar.gz: 50d19f3c6145d6184dc5d463cfde6684d609f797277b437103bf8114387d8570
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92253a2948b3492043b548c1ae3ccf23dc66e9da5dd14bdf6724e9c6f377ce53960fa4b689390d4242e1cd3090773b3de0caba8550a61cebde932564a2811a4d
|
7
|
+
data.tar.gz: 8c9ad6f1cdd747241d46e06ff444f84d7de7a73f6ae71b8b9e73406e11ad8748bf29ff3db3d837e7535ddb4c235e87f5b52b8999992811ae87e2dc00bbd96a76
|
@@ -238,7 +238,7 @@ module HTMLProofer
|
|
238
238
|
else
|
239
239
|
url
|
240
240
|
end
|
241
|
-
rescue Addressable::URI::InvalidURIError # rubocop:disable Lint/SuppressedException
|
241
|
+
rescue Addressable::URI::InvalidURIError # rubocop:disable Lint/SuppressedException -- error will be reported at check time
|
242
242
|
end
|
243
243
|
|
244
244
|
private def swap_urls!
|
@@ -20,18 +20,6 @@ module HTMLProofer
|
|
20
20
|
# does the image exist?
|
21
21
|
if missing_src?
|
22
22
|
add_failure("image has no src or srcset attribute", element: @img)
|
23
|
-
elsif @img.url.protocol_relative?
|
24
|
-
add_failure(
|
25
|
-
"image link #{@img.url} is a protocol-relative URL, use explicit https:// instead",
|
26
|
-
element: @img,
|
27
|
-
)
|
28
|
-
elsif @img.url.remote?
|
29
|
-
add_to_external_urls(@img.url, @img.line)
|
30
|
-
elsif !@img.url.exists? && !@img.multiple_srcsets? && !@img.multiple_sizes?
|
31
|
-
add_failure(
|
32
|
-
"internal image #{@img.url.raw_attribute} does not exist",
|
33
|
-
element: @img,
|
34
|
-
)
|
35
23
|
elsif @img.multiple_srcsets? || @img.multiple_sizes?
|
36
24
|
@img.srcsets_wo_sizes.each do |srcset|
|
37
25
|
srcset_url = HTMLProofer::Attribute::Url.new(@runner, srcset, base_url: @img.base_url, source: @img.url.source, filename: @img.url.filename, extract_size: true)
|
@@ -47,6 +35,18 @@ module HTMLProofer
|
|
47
35
|
add_failure("internal image #{srcset} does not exist", element: @img)
|
48
36
|
end
|
49
37
|
end
|
38
|
+
elsif @img.url.protocol_relative?
|
39
|
+
add_failure(
|
40
|
+
"image link #{@img.url} is a protocol-relative URL, use explicit https:// instead",
|
41
|
+
element: @img,
|
42
|
+
)
|
43
|
+
elsif @img.url.remote?
|
44
|
+
add_to_external_urls(@img.url, @img.line)
|
45
|
+
elsif !@img.url.exists? && !@img.multiple_srcsets? && !@img.multiple_sizes?
|
46
|
+
add_failure(
|
47
|
+
"internal image #{@img.url.raw_attribute} does not exist",
|
48
|
+
element: @img,
|
49
|
+
)
|
50
50
|
end
|
51
51
|
|
52
52
|
# if this is an img element, check that the alt attribute is present
|
data/lib/html_proofer/log.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: 5.0.
|
4
|
+
version: 5.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -212,7 +212,7 @@ licenses:
|
|
212
212
|
metadata:
|
213
213
|
funding_uri: https://github.com/sponsors/gjtorikian/
|
214
214
|
rubygems_mfa_required: 'true'
|
215
|
-
post_install_message:
|
215
|
+
post_install_message:
|
216
216
|
rdoc_options: []
|
217
217
|
require_paths:
|
218
218
|
- lib
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubygems_version: 3.5.3
|
234
|
-
signing_key:
|
234
|
+
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: A set of tests to validate your HTML output. These tests check if your image
|
237
237
|
references are legitimate, if they have alt tags, if your internal links are working,
|