-
-
Notifications
You must be signed in to change notification settings - Fork 213
Description
I'm new to web page building and am using Jekyll to build static .html from Markdown. This project seems to be the perfect match to check the links in the resulting files. And it found ... way too many (v5.0.8, installed via gem).
In particular, consider the generated HTML:
Lorem <a id="ipsum">Ipsum</a>. Etc pp.
Here html-proofer tells me:
'a' tag is missing a reference
The same is true for <a name="ipsum">Ipsum</a>.
Although the W3C validator sees no issue with this usage. The mdn web docs state on name/id attributes:
name: Was required to define a possible target location in a page. In HTML 4.01, id and name could both be used on <a>, as long as they had identical values. Note: Use the global attribute id instead.
In Issue #746 it was stated that one should rather err on the cautious side with empty href="" tags, and I can see that. However, there is a valid use for <a> without href attribute altogether -- if and only if at least one of the name or id attributes are present.