html-proofer 3.18.4 → 3.18.5

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: 8232203ce195b44adb3f672b9e132b75c81cfaad59dc8340e35c7f6183b8eb41
4
- data.tar.gz: 9ef4b713c060de1a91781725e0771842d8dd9a716a172ef23fa140929f12b8fc
3
+ metadata.gz: e90edda0dcb30f00baa440ec7b231bf73e086e0414fe9a1a56870940e2c15aeb
4
+ data.tar.gz: 2505df1fb597aaadfa68bf0f7c8b3d9380e27a236c31582d4c91840bf5e65623
5
5
  SHA512:
6
- metadata.gz: 7ec514672b80820d78e56a9773cb4dd6952f84ad8556b6271e1b64307b80c3c07c952ef9eea0c9fb87a4d578757e6c6c1dbac232265ac7f11301169fceb63da2
7
- data.tar.gz: d25e811c505fdc3f940b4646eb916db8d64de32ab03b7be707c5fa4e7fd94080722dc2e3147a257d2714cfaf83a9acc4abb9b636bb0400a409d41538842c72bc
6
+ metadata.gz: c5b864da4544723801ade7b906c387f893aed338ca36f9f3ae4a4660fa69f2f60883071cb2030cf526911abe954cf81932691a96c7c8f93e5e6970a18120449a
7
+ data.tar.gz: b141806119a645c1b974028f4e4ec3ecf60d74d51d1f5575d8b2fab4a3c7e90ddd8a6f8511474bd64825d49f591630ed8e9be83c1d5676b22b0f73b42ce93e3e
@@ -51,6 +51,11 @@ class LinkCheck < ::HTMLProofer::Check
51
51
  # curl/Typheous inaccurately return 404s for some links. cc https://git.io/vyCFx
52
52
  next if @link.respond_to?(:rel) && @link.rel == 'dns-prefetch'
53
53
 
54
+ unless @link.path?
55
+ add_issue("#{@link.href} is an invalid URL", line: line, content: content)
56
+ next
57
+ end
58
+
54
59
  add_to_external_urls(@link.href || @link.src)
55
60
  next
56
61
  elsif @link.internal?
@@ -74,6 +74,10 @@ module HTMLProofer
74
74
  !parts.nil?
75
75
  end
76
76
 
77
+ def path?
78
+ !parts.host.nil? && !parts.path.nil?
79
+ end
80
+
77
81
  def parts
78
82
  @parts ||= Addressable::URI.parse url
79
83
  rescue URI::Error, Addressable::URI::InvalidURIError
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTMLProofer
4
- VERSION = '3.18.4'
4
+ VERSION = '3.18.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.18.4
4
+ version: 3.18.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian