html-proofer 1.1.0 → 1.1.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/html-proofer.gemspec +1 -1
- data/lib/html/proofer/checks/favicon.rb +1 -1
- data/lib/html/proofer/checks/images.rb +1 -1
- data/lib/html/proofer/checks/links.rb +1 -1
- data/lib/html/proofer/checks/scripts.rb +1 -1
- data/spec/html/proofer/fixtures/links/anchors_in_pre.html +12 -0
- data/spec/html/proofer/fixtures/links/links_in_pre.html +13 -0
- data/spec/html/proofer/fixtures/scripts/script_in_pre.html +5 -0
- data/spec/html/proofer/links_spec.rb +12 -0
- data/spec/html/proofer/scripts_spec.rb +6 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c29174a0c6d66b27477dfa875f55ddaaf5233703
|
4
|
+
data.tar.gz: 53abcd611dd9bea328900554a44e2480c061056d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56af59c05d01d8401ff70cab45f46960afd81b03588ba5054f8f5b97dc5f68564ccefddd79aafce0c94f74b1b1b8a2441621970e38dea84c708a8488b1a0af0f
|
7
|
+
data.tar.gz: b9402d34ea0c1f5ffe9e5ba9b6657b557a9ed86d73f6cee8a741034ffba39b1f82d042eec40d20cdf0ec8570ec15a31a6c51291d62c35aa6e98c052c3c20f2f4
|
data/html-proofer.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "html-proofer"
|
6
|
-
gem.version = "1.1.
|
6
|
+
gem.version = "1.1.1"
|
7
7
|
gem.authors = ["Garen Torikian"]
|
8
8
|
gem.email = ["gjtorikian@gmail.com"]
|
9
9
|
gem.description = %q{Test your rendered HTML files to make sure they're accurate.}
|
@@ -11,7 +11,7 @@ class Favicons < ::HTML::Proofer::Checks::Check
|
|
11
11
|
def run
|
12
12
|
return unless @options[:favicon]
|
13
13
|
|
14
|
-
@html.
|
14
|
+
@html.xpath("//link[not(ancestor::pre or ancestor::code)]").each do |favicon|
|
15
15
|
favicon = Favicon.new favicon, "favicon", self
|
16
16
|
return if favicon.rel.split(" ").last.eql? "icon"
|
17
17
|
end
|
@@ -19,7 +19,7 @@ end
|
|
19
19
|
class Links < ::HTML::Proofer::Checks::Check
|
20
20
|
|
21
21
|
def run
|
22
|
-
@html.
|
22
|
+
@html.xpath('//a[not(ancestor::pre or ancestor::code)]', '//link[not(ancestor::pre or ancestor::code)]').each do |l|
|
23
23
|
link = Link.new l, "link", self
|
24
24
|
|
25
25
|
next if link.ignore?
|
@@ -171,4 +171,16 @@ describe "Links test" do
|
|
171
171
|
output = capture_stderr { HTML::Proofer.new(["www.github.com", "foofoofoo.biz"], options).run }
|
172
172
|
output.should match /foofoo.biz\/? failed: 0 Couldn't resolve host name/
|
173
173
|
end
|
174
|
+
|
175
|
+
it "works for broken anchors within pre" do
|
176
|
+
anchor_pre = "#{FIXTURES_DIR}/links/anchors_in_pre.html"
|
177
|
+
output = capture_stderr { HTML::Proofer.new(anchor_pre).run }
|
178
|
+
output.should == ""
|
179
|
+
end
|
180
|
+
|
181
|
+
it "works for broken link within pre" do
|
182
|
+
link_pre = "#{FIXTURES_DIR}/links/links_in_pre.html"
|
183
|
+
output = capture_stderr { HTML::Proofer.new(link_pre).run }
|
184
|
+
output.should == ""
|
185
|
+
end
|
174
186
|
end
|
@@ -32,4 +32,10 @@ describe "Scripts test" do
|
|
32
32
|
output.should match /script is empty and has no src attribute/
|
33
33
|
end
|
34
34
|
|
35
|
+
it "works for broken script within pre" do
|
36
|
+
script_pre = "#{FIXTURES_DIR}/scripts/script_in_pre.html"
|
37
|
+
output = capture_stderr { HTML::Proofer.new(script_pre).run }
|
38
|
+
output.should == ""
|
39
|
+
end
|
40
|
+
|
35
41
|
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.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- spec/html/proofer/fixtures/images/rootRelativeImages.html
|
183
183
|
- spec/html/proofer/fixtures/images/terribleImageName.html
|
184
184
|
- spec/html/proofer/fixtures/images/workingDataURIImage.html
|
185
|
+
- spec/html/proofer/fixtures/links/anchors_in_pre.html
|
185
186
|
- spec/html/proofer/fixtures/links/blank_mailto_link.html
|
186
187
|
- spec/html/proofer/fixtures/links/blank_tel_link.html
|
187
188
|
- spec/html/proofer/fixtures/links/brokenHashExternal.html
|
@@ -209,6 +210,7 @@ files:
|
|
209
210
|
- spec/html/proofer/fixtures/links/link_directory_without_slash.html
|
210
211
|
- spec/html/proofer/fixtures/links/link_missing_protocol_invalid.html
|
211
212
|
- spec/html/proofer/fixtures/links/link_missing_protocol_valid.html
|
213
|
+
- spec/html/proofer/fixtures/links/links_in_pre.html
|
212
214
|
- spec/html/proofer/fixtures/links/mailto_link.html
|
213
215
|
- spec/html/proofer/fixtures/links/missingLinkHref.html
|
214
216
|
- spec/html/proofer/fixtures/links/multipleProblems.html
|
@@ -226,6 +228,7 @@ files:
|
|
226
228
|
- spec/html/proofer/fixtures/scripts/script_broken_external.html
|
227
229
|
- spec/html/proofer/fixtures/scripts/script_content.html
|
228
230
|
- spec/html/proofer/fixtures/scripts/script_content_absent.html
|
231
|
+
- spec/html/proofer/fixtures/scripts/script_in_pre.html
|
229
232
|
- spec/html/proofer/fixtures/scripts/script_missing_internal.html
|
230
233
|
- spec/html/proofer/fixtures/scripts/script_valid_internal.html
|
231
234
|
- spec/html/proofer/images_spec.rb
|
@@ -282,6 +285,7 @@ test_files:
|
|
282
285
|
- spec/html/proofer/fixtures/images/rootRelativeImages.html
|
283
286
|
- spec/html/proofer/fixtures/images/terribleImageName.html
|
284
287
|
- spec/html/proofer/fixtures/images/workingDataURIImage.html
|
288
|
+
- spec/html/proofer/fixtures/links/anchors_in_pre.html
|
285
289
|
- spec/html/proofer/fixtures/links/blank_mailto_link.html
|
286
290
|
- spec/html/proofer/fixtures/links/blank_tel_link.html
|
287
291
|
- spec/html/proofer/fixtures/links/brokenHashExternal.html
|
@@ -309,6 +313,7 @@ test_files:
|
|
309
313
|
- spec/html/proofer/fixtures/links/link_directory_without_slash.html
|
310
314
|
- spec/html/proofer/fixtures/links/link_missing_protocol_invalid.html
|
311
315
|
- spec/html/proofer/fixtures/links/link_missing_protocol_valid.html
|
316
|
+
- spec/html/proofer/fixtures/links/links_in_pre.html
|
312
317
|
- spec/html/proofer/fixtures/links/mailto_link.html
|
313
318
|
- spec/html/proofer/fixtures/links/missingLinkHref.html
|
314
319
|
- spec/html/proofer/fixtures/links/multipleProblems.html
|
@@ -326,6 +331,7 @@ test_files:
|
|
326
331
|
- spec/html/proofer/fixtures/scripts/script_broken_external.html
|
327
332
|
- spec/html/proofer/fixtures/scripts/script_content.html
|
328
333
|
- spec/html/proofer/fixtures/scripts/script_content_absent.html
|
334
|
+
- spec/html/proofer/fixtures/scripts/script_in_pre.html
|
329
335
|
- spec/html/proofer/fixtures/scripts/script_missing_internal.html
|
330
336
|
- spec/html/proofer/fixtures/scripts/script_valid_internal.html
|
331
337
|
- spec/html/proofer/images_spec.rb
|