-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hash ref's on the same page aren't found #725
Comments
Unfortunately, it looks like Tina's website uses Javascript to add anchor tags. html-proofer only works on static site generators which produce their HTML beforehead. When I look at the website's source, there's no reference to a |
So the site is built with NextJS, and the html is built built statically. This has always worked in the past with this package, until the latest 4.0.1 release Here's the output for this file (it's ugly, but it does have a
|
Hmm, odd. Let me take a closer look. |
I see If this worked before, it may have been working incorrectly (i.e., passing when it shouldn't have passed). |
I think I see. Remove Edit: HTML-Proofer 4 now assumes extension by default, and the behavior of this option has changed here. |
Just tried removing that flag and still getting the same error. |
Hi @jamespohalloran, was curious about this and did a quick check: I can second @gjtorikian on
If you look at Not sure about the HTML you included above #725 (comment), perhaps it is the content of the page after being populated by Javascript Hope this helps |
Hmm, well I'm a bit stumped about why that may be. But! I'm actually running the check on pregenerated html in an output directory and not our live site. The generated output file does have these id's If I'm the only one running into this though, maybe there is something weird going on in my stack.. |
@jamespohalloran Could you zip up your build output and attach it here? |
I see... if I save what you pasted in the comment above to
(Running with 4.0.1 explicitly, same for the latest 4.2.0)
For comparison, saving the live website page as
|
I face the same issue, HTMLProofer fails to find hash links that work perfectly in the browser, here's an example of a failed build: https://github.com/yktoo/yktoo.com/runs/7522465522 It's about a static website, fully generated out at build time by Hugo. Adding |
@yktoo I was able to fix your issue in #741, and I am hoping that it also resolves the issue @jamespohalloran is seeing. Feel free to reopen if it's not correct. |
I'm using this tool to run htmlproofer as a GitHub action, is there a known way to test this change? (My builds are still using htmlproofer 4.2.0) |
@jamespohalloran, the action |
@gjtorikian I'm now getting (see this build):
That used to work in the previous version of HTMLProofer. Update: I seem to have been sloppy with the arguments. With HTMLProofer 4.3.0 this command succeeds: bundle exec htmlproofer public/
--allow-missing-href true
--checks Links,Images,Scripts,Favicon,OpenGraph
--disable-external true
--enforce-https false
--ignore-empty-mailto true Thanks for the fix! |
My htmlproofer check is failing on hash links to the same page.
Getting the following errors:
You can see that the hash in the link does in fact exist at: https://tina.io/docs/cli-overview/#init
Setup
I'm using the following config:
htmlproofer 4.0.1
The text was updated successfully, but these errors were encountered: