metalsmith-broken-link-checker
metalsmith-broken-link-checker copied to clipboard
should links to null url be warned?
I discover that null links are reported to be broken:
Error: Link is broken: href: "", text: "dev for business", in file: business-web\index.html
In my opinion, null link are either invalid or valid. But they should not be considered as broken.
Don't you think?
As metalsmith-broken-link-checker is only checking internal links, a null link is neither internal neither external. It is just a null link.
I'm not really sure what you mean by a null link. If a link is simply missing a href attribute completely then I think it won't render properly as a link in some browsers. A link with empty text will reload the page (which probably isn't what you want). The usual way to do it is with "#" or "javascript:void(0);" which should both be allowed by the link checker I think.
Could you give some more explanation?
By null link, I mean a link whose href attribute is null: <a href="" alt="no desc" />
Such links are reported to be broken, but they are not!
I agree with @davidxmoody that they should be errors, because usually you don't actually want to do that. But if you do, you can already add an exception like:
.use(blc({
allowRegex: /^$/,
}))
and then links like <a href=""> will be allowed.