html-proofer 5.2.0 → 5.2.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/runner.rb +1 -1
- data/lib/html_proofer/url_validator/internal.rb +16 -5
- data/lib/html_proofer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9883d35b171b2912cb327e9360f7ff63fcecaaff8cafa44c04eb7ba38c2ea226
|
|
4
|
+
data.tar.gz: '009a17164398c5bfd6456d6c0235e8606cd9bc98602ac392e11269e49574867e'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02ba6094a5a0516d6452b72d898be194cc1c2ace2779e6c21b688116b2335dd55704c78ba614cac7d5aab56fa0557b18e82fb0c1d0f084954bc012de584f52e3
|
|
7
|
+
data.tar.gz: 0cf8697a7bb36c0213ee62596323e21679d0bc679315aee33ab521bea8675f13d8a2adf3a9f8be7284fd488686629b9e18b2fbcbafc7b59b88d424daa063b50e
|
data/lib/html_proofer/runner.rb
CHANGED
|
@@ -116,10 +116,13 @@ module HTMLProofer
|
|
|
116
116
|
return true if blank?(href_hash)
|
|
117
117
|
return true unless @runner.options[:check_internal_hash]
|
|
118
118
|
|
|
119
|
-
#
|
|
120
|
-
|
|
119
|
+
# For hash links, we need to defer to file-based checking
|
|
120
|
+
# (even if URL doesn't have extension, it may resolve to index.html)
|
|
121
121
|
return false unless url.has_hash?
|
|
122
122
|
|
|
123
|
+
# If URL has no known extension, defer to file-based checking
|
|
124
|
+
return false unless url.known_extension?
|
|
125
|
+
|
|
123
126
|
decoded_href_hash = Addressable::URI.unescape(href_hash)
|
|
124
127
|
fragment_ids = [href_hash, decoded_href_hash]
|
|
125
128
|
# https://www.w3.org/TR/html5/single-page.html#scroll-to-fragid
|
|
@@ -134,10 +137,18 @@ module HTMLProofer
|
|
|
134
137
|
|
|
135
138
|
private def find_fragments(fragment_ids, html)
|
|
136
139
|
xpaths = fragment_ids.uniq.flat_map do |frag_id|
|
|
137
|
-
|
|
140
|
+
# Build XPath string argument, handling single quotes
|
|
141
|
+
if frag_id.include?("'")
|
|
142
|
+
# Use concat() to handle single quotes: concat('part1', "'", 'part2')
|
|
143
|
+
escaped_frag_id = frag_id.split("'").map { |part| "'#{part}'" }.join(", \"'\", ")
|
|
144
|
+
xpath_arg = "concat(#{escaped_frag_id})"
|
|
145
|
+
else
|
|
146
|
+
# No single quotes, just use quoted string
|
|
147
|
+
xpath_arg = "'#{frag_id}'"
|
|
148
|
+
end
|
|
138
149
|
[
|
|
139
|
-
"//*[case_sensitive_equals(@id,
|
|
140
|
-
"//*[case_sensitive_equals(@name,
|
|
150
|
+
"//*[case_sensitive_equals(@id, #{xpath_arg})]",
|
|
151
|
+
"//*[case_sensitive_equals(@name, #{xpath_arg})]",
|
|
141
152
|
]
|
|
142
153
|
end
|
|
143
154
|
xpaths << XpathFunctions.new
|
data/lib/html_proofer/version.rb
CHANGED
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: 5.2.
|
|
4
|
+
version: 5.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
234
234
|
- !ruby/object:Gem::Version
|
|
235
235
|
version: '0'
|
|
236
236
|
requirements: []
|
|
237
|
-
rubygems_version: 4.0.
|
|
237
|
+
rubygems_version: 4.0.6
|
|
238
238
|
specification_version: 4
|
|
239
239
|
summary: A set of tests to validate your HTML output. These tests check if your image
|
|
240
240
|
references are legitimate, if they have alt tags, if your internal links are working,
|