html-proofer 1.5.0 → 1.5.1

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
  SHA1:
3
- metadata.gz: 892dbf1a283cd5c3bf33d9a76430371d035f3abe
4
- data.tar.gz: e4b6498ca79d5ad258f5763c005f039599304434
3
+ metadata.gz: 4c622a3354112dd4ac8d59a58292741dc24a150d
4
+ data.tar.gz: b8307e82ef4e1ae216fca8abc1b94bb803ba4d42
5
5
  SHA512:
6
- metadata.gz: fc79438fbab4a5e7d7e9c9f318d3cfb71e315e6028a1b9b0e1934babb6a4aa046930ff830cf193baffec171785421d28fdbfb5470b6e8781a6ecaaed4eecfece
7
- data.tar.gz: 45ff2420a45ebda37369dfcf713f4b9aa89ba3e8f4278c705345fa83915cf6fe5d76cf04b1a80b102fb4123f9c3ba365eceb4f0a808f66011f4f6665fc15807c
6
+ metadata.gz: c8b3ba745f522ff5f93978eb9f487b328b8da581d8780120cfe8fd553cf5e0a065186371e0f1db142da901b62a8d7785e258f7a0103a53ebb3126964b30aef9f
7
+ data.tar.gz: fd978b7e7cbca7c92f7e2b181f94f4750ae4301d53d7e5ae8c1c561998c22f05d4f0e1425d22dcf03b2b3ee08aa35ba9984d00176ac4b0a7b38b9a0360a1e7f7
data/lib/html/proofer.rb CHANGED
@@ -187,11 +187,9 @@ module HTML
187
187
  if hash = has_hash?(href)
188
188
  body_doc = Nokogiri::HTML(response.body)
189
189
  # user-content is a special addition by GitHub.
190
- if URI.parse(href).host.match(/github\.com/i)
191
- if body_doc.xpath(%$//*[@name="user-content-#{hash}"]|//*[@id="user-content-#{hash}"]$).empty?
192
- add_failed_tests filenames, "External link #{href} failed: #{effective_url} exists, but the hash '#{hash}' does not", response_code
193
- end
194
- elsif body_doc.xpath(%$//*[@name="#{hash}"]|//*[@id="#{hash}"]$).empty?
190
+ xpath = %$//*[@name="#{hash}"]|//*[@id="#{hash}"]$
191
+ xpath << %$|//*[@name="user-content-#{hash}"]|//*[@id="user-content-#{hash}"]$ if URI.parse(href).host.match(/github\.com/i)
192
+ if body_doc.xpath(xpath).empty?
195
193
  add_failed_tests filenames, "External link #{href} failed: #{effective_url} exists, but the hash '#{hash}' does not", response_code
196
194
  end
197
195
  end
@@ -1,5 +1,5 @@
1
1
  module HTML
2
2
  class Proofer
3
- VERSION = "1.5.0"
3
+ VERSION = "1.5.1"
4
4
  end
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: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian