Comments (6)
Curiously, name
is listed under Deprecated attributes
; this project has only ever really attempted to target HTML 5.
The single id
rather than href
is interesting, I never knew that. Would the suggestion of setting allow_missing_href = true
work for you though?
from html-proofer.
Thanks for the quick reply.
I only quoted the name
attribute as it included a description of what it was meant for, i.e. what id
is being used for here. Don't know if this is a common thing to do nowadays, though. I just changed the name
with id
when preparing my texts, out of habit of old when <a name="...">
was the only way to define anchors (that I knew of).
The single
id
rather thanhref
is interesting, I never knew that. Would the suggestion of settingallow_missing_href = true
work for you though?
In the sense of not showing the warning for <a id="...">
yes, it will not show the message. However, I would also not be notified in the rare cases where I might actually have missed to fill in the href
, unfortunately.
To provide context: running html-proofer on my project as-is results in about 2000 failures, by far the most are "'a' tag is missing a reference" messages - I'd guess that at most five of those are actually missing hrefs
and all others are of the <a id="...">
kind. I would have to verify each and every one to find them, though.
from html-proofer.
Cheers, I've hit this issue as well, with asciidoc
generated HTML pages which also use <a id="token"></a>
anchors and elsewhere the <a href="#token">Some text</a>
references.
Per https://www.w3schools.com/tags/tag_a.asp this is valid, the a
tag accepts "Global Attributes" which include an id
: https://www.w3schools.com/tags/ref_standardattributes.asp
It seems that the <a name=...>
syntax is obsolete (not documented in the page above); Q&A like https://stackoverflow.com/questions/16974480/if-a-name-is-obsolete-what-is-preferred confirm that. The name
attribute is known for some other tags/elements: https://www.w3schools.com/tags/att_name.asp
from html-proofer.
To answer the additional question above, at least with htmlproofer 3.14.1 (as available in the Ubuntu 22 that I have under hand), and command-line tool usage, the option did not help:
- In full form - "needless":
:; htmlproofer --allow_missing_href=true protocols/apcsmart.html
/usr/share/rubygems-integration/all/gems/mercenary-0.3.6/lib/mercenary/program.rb:31:in `go': needless argument: --allow_missing_href=true (OptionParser::NeedlessArgument)
from /usr/share/rubygems-integration/all/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /usr/bin/htmlproofer:11:in `<main>'
- In short form - no effect:
:; htmlproofer --allow_missing_href --disable-external protocols/apcsmart.html
Running ["ImageCheck", "LinkCheck", "ScriptCheck"] on protocols/apcsmart.html on *.html...
Ran on 1 file!
- protocols/apcsmart.html
* linking to internal hash #@ that does not exist (line 729)
<a href="#@"><strong></strong></a>
* linking to internal hash #B that does not exist (line 508)
<a href="#B">actual voltage</a>
* linking to internal hash #B that does not exist (line 515)
<a href="#B">current battery voltage</a>
...
* linking to internal hash #x that does not exist (line 708)
<a href="#x">battery change date</a>
htmlproofer 3.14.1 | Error: HTML-Proofer found 23 failures!
/usr/lib/ruby/vendor_ruby/html-proofer/runner.rb:172:in `print_failed_tests': \e[31mHTML-Proofer found 23 failures!\e[0m (RuntimeError)
from /usr/lib/ruby/vendor_ruby/html-proofer/runner.rb:50:in `run'
from /usr/bin/htmlproofer:105:in `block (2 levels) in <main>'
from /usr/share/rubygems-integration/all/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
from /usr/share/rubygems-integration/all/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
from /usr/share/rubygems-integration/all/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
from /usr/share/rubygems-integration/all/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /usr/share/rubygems-integration/all/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /usr/bin/htmlproofer:11:in `<main>'
A variant of the page is available at https://networkupstools.org/protocols/apcsmart.html and links like https://networkupstools.org/protocols/apcsmart.html#R do work in a browser to jump to referred parts of the table etc.
from html-proofer.
Curiously, I haven't seen complaints about 'a' tag is missing a reference
on the systems I've tried (also checked htmlproofer 3.19.2 on Debian 12).
But given that the current release is 5.0.9, maybe that complaint just appeared "too recently" :)
from html-proofer.
UPDATE: With a custom-built 5.0.9, it seems to mostly like the existing file (at least, WRT the internal hash links).
from html-proofer.
Related Issues (20)
- Official HTMLProofer Docker image HOT 2
- 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
- Want documentation (or even feature?) to parallelize local scans 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.