If I check a page on my website, such as the index, where I have a link to #top at the bottom of the page for the convenience of readers (along with the standard 'return-to-top' floating widget), the link checker throws an error:
Some of the links to this resource point to broken URI fragments (such as index.html#fragment).
Broken fragments:
https://www.gwern.net/index#top (line 3164)
The link works fine, and as I understand it, #top and # are guaranteed to exist and be valid anchor references defined at runtime by a standards-compliant browser according to [MDN]():
You can use href="#top" or the empty fragment (href="#") to link to the top of the current page, as defined in the HTML specification.
The specification linked does say
Let fragment be the document's URL's fragment. If fragment is the empty string, then the indicated part of the document is the top of the document; return.
So # is definitely required to exist & be valid by the standard; I'm unsure where top is defined but MDN and everyone else seems to think it's defined exactly the same way.
So both #top and # will always be valid anchor links, and any error by the link-checker is always a false positive. They should be whitelisted and not appear in the output.
If I check a page on my website, such as the index, where I have a link to
#top
at the bottom of the page for the convenience of readers (along with the standard 'return-to-top' floating widget), the link checker throws an error:The link works fine, and as I understand it,
#top
and#
are guaranteed to exist and be valid anchor references defined at runtime by a standards-compliant browser according to [MDN]():The specification linked does say
So
#
is definitely required to exist & be valid by the standard; I'm unsure wheretop
is defined but MDN and everyone else seems to think it's defined exactly the same way.So both
#top
and#
will always be valid anchor links, and any error by the link-checker is always a false positive. They should be whitelisted and not appear in the output.