Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is rel="canonical" forbidden on a? #8274

Open
brennanyoung opened this issue Sep 8, 2022 · 0 comments
Open

Why is rel="canonical" forbidden on a? #8274

brennanyoung opened this issue Sep 8, 2022 · 0 comments

Comments

@brennanyoung
Copy link

brennanyoung commented Sep 8, 2022

https://html.spec.whatwg.org/multipage/links.html#linkTypes indicates that rel="canonical" is not allowed on clickable links (i.e. <a> and <area> elements), but I can find no explanation for this.

Documents that appear in multiple versions, typically have a clickable hyperlink to the official or latest version near the top. Very often a draft spec is in play for months or years, so it's important to be able to compare with the canonical version - by clicking.

So I'd expect to be able to find rel="canonical" right there on the <a> that points to the latest official doc, but I don't, and yes it would go against the spec to do so.

But why is this attribute restricted to 'offscreen' links?

Other common link relationships are "latest draft", "previous version" etc. This is all very useful semantic metadata. Would it be wrong to use rel="prev" for "previous version"? (This is allowed). I imagine that this is more of a pagination feature, than a versioning mechanism, but the spec leaves room for doubt.

Have I misunderstood what rel is about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant