Coder Social home page Coder Social logo

Comments (15)

doktorbro avatar doktorbro commented on August 16, 2024

After adding the missing file the issue is gone. But it is just a workaround. The question is, why Proofer tries to proof an non-existent file?

from html-proofer.

gjtorikian avatar gjtorikian commented on August 16, 2024

It's more a feature then a bug. Basically, like every browser ever, Proofer expects there to be a top-level index.html file when you navigate to a folder. For pages with clean URLs (or just using Jekyll), checking for an index.html is really handy.

The workaround suggested was to add data-proofer-ignore to the anchor. I could in the future add an option to disable assumption of index.html but I have not seen it as a problem yet.

from html-proofer.

parkr avatar parkr commented on August 16, 2024

Basically, like every browser ever, Proofer expects there to be a top-level index.html file when you navigate to a folder.

If the link is to a folder, then it can be any number of things (index.html, index.htm, index.shtml, index.php, index.xml, etc) depending upon the server setup. You're not assuming there's going to be an index.html file for every folder level, right? Just for those directories being linked to?

from html-proofer.

gjtorikian avatar gjtorikian commented on August 16, 2024

shifty eyes

file = File.join path, "index.html" if File.directory? File.expand_path file, @check.src

You're not assuming there's going to be an index.html file for every folder level, right? Just for those directories being linked to?

Yes. But now your mention of all those other file types has me in a tizzy. 😩

from html-proofer.

parkr avatar parkr commented on August 16, 2024

Yes. But now your mention of all those other file types has me in a tizzy.

I think HTMLProofer can assume either html, htm, or xhtml. But honestly... should this be a tool for legacy sites? 😉

shifty eyes

If @check.src is a dir, then I think it's safe to assume you should check for a common index file. Maybe that can be a config option? :trollface:

from html-proofer.

doktorbro avatar doktorbro commented on August 16, 2024

@gjtorikian The error occurs while you load the source files with outgoing links before you start to check anything: https://github.com/gjtorikian/html-proofer/blob/master/lib/html/proofer.rb#L25 Nevermind.

from html-proofer.

nschonni avatar nschonni commented on August 16, 2024

Yeah, I just ran into this one as well https://travis-ci.org/nschonni/wet-boew/builds/32812844#L2463
Slight difference was that there is no link to a folder root, but just rally long query string plus anchor link (I think that is what is tripping it, but there is no trace back)

from html-proofer.

doktorbro avatar doktorbro commented on August 16, 2024

@nschonni Can you please provide the exact link?

This is your situation now, right?

# does not exist
dist/demos/texthighlight/index.html

# do exist
dist/demos/texthighlight/texthighlight-fr.html
dist/demos/texthighlight/texthighlight-en.html

from html-proofer.

nschonni avatar nschonni commented on August 16, 2024

@penibelst I believe the link it's having trouble with is ?txthl=avian%20influenza+world+cook+flu-like%20symptoms+Don't%20Forget...+causes%20sickness%20in%20birds,%20it%20can%20also%20infect%20people.#example from here https://github.com/wet-boew/wet-boew-dist/blob/4b3ea7429223726c674350737cd879bc31992c3e/demos/texthighlight/texthighlight-en.html#L136

You can grab the prebuilt site if you want to test it out https://github.com/wet-boew/wet-boew-dist

Oddly enough, if I add :followlocation => false and :disable_external => true then it runs, although then other missing trailing slashes are found, but it no longer crashes.

from html-proofer.

doktorbro avatar doktorbro commented on August 16, 2024

I think #93 fixes all the mentioned issues.

from html-proofer.

doktorbro avatar doktorbro commented on August 16, 2024

@nschonni The version 1.3.0 fixes your issue.

from html-proofer.

nschonni avatar nschonni commented on August 16, 2024

Thanks @penibelst! It's not crashing anymore, but it just stalls out completely https://travis-ci.org/nschonni/wet-boew/builds/33367787
I'll see if I can find a combo of options that lets it run again.

from html-proofer.

doktorbro avatar doktorbro commented on August 16, 2024

@nschonni Can you please start Proofer with only one file?

HTML::Proofer.new("example.html").run

from html-proofer.

nschonni avatar nschonni commented on August 16, 2024

Yeah, running a smaller set help, but it's taking almost 10minutes to run on less than 200 pages now. Getting false positives for the href links, not sure if it's tripping on HTML5 elements, but this is the wrong thread for that 😉

from html-proofer.

doktorbro avatar doktorbro commented on August 16, 2024

@nschonni External URLs are unpredictable. Try the timeout option:

HTML::Proofer.new(dir, {
  :timeout => 10 # seconds
}).run

If you see false positives, please open a new issue with examples.

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.