Comments (10)
Looks like it's this bit of code
# does the file even exist?
if link.remote?
add_to_external_urls link.href
else
self.add_issue "internally linking to #{link.href}, which does not exist" unless link.exists?
end
It's trying to see if the file '' exists, it should skip this check for internal links
from html-proofer.
I'm not sure but I think this started after a recent update (to 1.3.1 or 1.3.0), earlier builds did not give this problem eg. https://travis-ci.org/GeoDienstenCentrum/geodienstencentrum.github.io/builds/32709271
which I think would have been running v. 1.2.1
from html-proofer.
Version 1.3.1 here
index.htm: internally linking to #q3, which does not exist
index.htm: internally linking to #q4, which does not exist
index.htm: internally linking to #q5, which does not exist
index.htm: internally linking to #q6, which does not exist
index.htm: internally linking to #q7, which does not exist
index.htm: internally linking to #q8, which does not exist
index.htm: internally linking to #q9, which does not exist
index.htm: internally linking to #q10, which does not exist
index.htm: internally linking to #q11, which does not exist
index.htm: internally linking to #q12, which does not exist
index.htm: internally linking to #q13, which does not exist
index.htm: internally linking to #q14, which does not exist
index.htm: internally linking to #q15, which does not exist
index.htm: internally linking to #q16, which does not exist
index.htm: internally linking to #q17, which does not exist
index.htm: internally linking to #q18, which does not exist
index.htm: internally linking to #q19, which does not exist
index.htm: internally linking to #q20, which does not exist
htmlproof 1.3.1 | Error: HTML-Proofer found 22 failures!
from html-proofer.
definitely something that appeared after 1.2.1 (https://travis-ci.org/GeoDienstenCentrum/geodienstencentrum.github.io/builds/33591606)
from html-proofer.
Strange, running that sample HTML file above locally does not produce the error for me.
from html-proofer.
Cloning the repo, building the site, and running the same Travis command (htmlproof ./_site/ --favicon --verbose
) does yield the error for me. So this will be fun. 😝
from html-proofer.
@gjtorikian Same here.
from html-proofer.
@dalejefferson Can you please provide more information about your case?
from html-proofer.
Nope @penibelst I got a repro case. This is pretty bad. 😦 I might do a poor job explaining.
As noted above, the failure is here:
if link.remote?
add_to_external_urls link.href
else
self.add_issue "internally linking to #{link.href}, which does not exist" unless link.exists?
end
When I set up the test case locally, the hash expands to
"/html-proofer/spec/html/proofer/fixtures/links/index.html"
, and it causes link.exists?
to return true
. Then, it proceeds down to actually look at the hash internally, and the test passes.
In the failure case, the link is expanded the same way, but because there's no index.html file, the test fails. This is actually correct--there's a bug in the way exists?
depends on [absolute_path](https://github.com/gjtorikian/html-proofer/blob/88e1b201971bed2c01379e35de07e1fef76c1b77/lib/html/proofer/checkable.rb#L116)
.
In this case I think it would be best to skip checking whether the file exists if the link starts with a "#," since the hash check is later on down.
from html-proofer.
In this case I think it would be best to skip checking whether the file exists if the link starts with a "#," since the hash check is later on down.
@gjtorikian I agree.
from html-proofer.
Related Issues (20)
- v5 upgrade guide? HOT 1
- Reporting broken links when using relative internal links reported as broken HOT 11
- Fails multi email mailto
- Add --ignore-internal flag HOT 4
- Error for http only sites HOT 5
- allow_missing_href started giving false positives since v4.3 HOT 2
- cyn.eth
- HTTP 302 (to the same URL?) reported as failures HOT 2
- Error during deployment with scheme format HOT 3
- Question - setting up html proofer to skip new pages added to a website which will return a 404 HOT 3
- "ERROR: Invalid predicate" on ugly Maven search URL HOT 2
- Manager
- Small extra hint for beginners HOT 2
- Ruby 3.3.0 parameters bug HOT 3
- CI output disappeared when running htmlproofer, only raw logs show errors HOT 1
- The regex in Attribute::URL.clean_url is very slow for JavaScript bookmarklet URLs HOT 2
- Allow color in non tty shell HOT 7
- Link checker triggered on <a name="..."> and <a id="..."> HOT 6
- Want documentation (or even feature?) to parallelize local scans HOT 1
- Configuration by file? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-proofer.