Munter / hyperlink

A node library and command line tool to test the integrity of your internal an external hyperlinks
231 stars 24 forks source link

False negatives #182

Closed Znarkus closed 4 years ago

Znarkus commented 4 years ago

Running hyperlink with -p -v -r dist/index.html and getting false negatives like this:

not ok 21 load dist/set-designer-1

Which is strange since set-designer-1 is never referenced in any of the files in dist/. Any idea what's going on? I could send the dist/ folder if it would help, or if you could give me some pointers where I should start to debug :)

papandreou commented 4 years ago

Can you share the contents of your dist folder? Then we can take a look.

Znarkus commented 4 years ago

Sure! https://www.dropbox.com/s/agf159wdyuitgtv/dist.zip?dl=0

Munter commented 4 years ago

First intuition is were not handling the difference between links that end in slashes and non-slashes to the same asset very well. Looks like assetgraph's mechanism to uniquely identify different assets by adding a name differentiator was triggered

papandreou commented 4 years ago

Yeah, it happens in https://github.com/Munter/hyperlink/blob/d07ea7caa8337bb68aa73221fac979435cfc4d10/lib/index.js#L485 when the target asset has already been visited. I've implemented a fix here: https://github.com/Munter/hyperlink/pull/183