Coder Social home page Coder Social logo

Comments (10)

DaleLJefferson avatar DaleLJefferson commented on August 16, 2024

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.

mprins avatar mprins commented on August 16, 2024

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.

DaleLJefferson avatar DaleLJefferson commented on August 16, 2024

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.

mprins avatar mprins commented on August 16, 2024

definitely something that appeared after 1.2.1 (https://travis-ci.org/GeoDienstenCentrum/geodienstencentrum.github.io/builds/33591606)

from html-proofer.

gjtorikian avatar gjtorikian commented on August 16, 2024

Strange, running that sample HTML file above locally does not produce the error for me.

from html-proofer.

gjtorikian avatar gjtorikian commented on August 16, 2024

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.

doktorbro avatar doktorbro commented on August 16, 2024

@gjtorikian Same here.

from html-proofer.

doktorbro avatar doktorbro commented on August 16, 2024

@dalejefferson Can you please provide more information about your case?

from html-proofer.

gjtorikian avatar gjtorikian commented on August 16, 2024

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.

doktorbro avatar doktorbro commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.