Code Monkey home page Code Monkey logo

Comments (6)

gjtorikian avatar gjtorikian commented on July 3, 2024

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.

franke-biosaxs avatar franke-biosaxs commented on July 3, 2024

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 than href is interesting, I never knew that. Would the suggestion of setting allow_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.

jimklimov avatar jimklimov commented on July 3, 2024

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.

jimklimov avatar jimklimov commented on July 3, 2024

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.

jimklimov avatar jimklimov commented on July 3, 2024

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.

jimklimov avatar jimklimov commented on July 3, 2024

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)

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.