html-proofer 1.5.0 → 1.5.1
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.rb +3 -5
- data/lib/html/proofer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c622a3354112dd4ac8d59a58292741dc24a150d
|
|
4
|
+
data.tar.gz: b8307e82ef4e1ae216fca8abc1b94bb803ba4d42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
data/lib/html/proofer/version.rb
CHANGED