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

“other similar links” is a vague description for what constitutes getting mentioned in HTML #91

Open
Zegnat opened this issue Aug 24, 2017 · 2 comments

Comments

@Zegnat
Copy link

Zegnat commented Aug 24, 2017

Prompted by aaronpk/Telegraph#20 and indieweb/mention-client-php#33.

I am wondering what exactly is considered a mention of a link in an HTML file. 3.2.2 Webmention Verification keeps relatively agnostic on data format but does say the following:

For example, in an [ HTML5] document, the receiver should look for <a href="*">, <img href="*">, <video src="*"> and other similar links.

(Note that this is a “for example”, using “should” within a SHOULD section of the specification.)

It calls out a, img, and video elements specifically, but does not note what type of links it considers “similar”. AFAIK there is no category within the HTML5 spec that includes all three of these elements.

HTML5 does have 4.8 Links which includes a, area, and link. Would those be considered “similar links”? An argument that came up in the IndieWeb development chat around this was that a link for Webmentions means the “*user* concept of a link”, but that would definitely exclude link elements that usually aren’t displayed.

The call-out to img and video is interesting too, as it would be a sign of hotlinking a resource, not so much mentioning it. And interesting because these use the src attribute rather than href. Supporting video is actually a multiple step thing, as it implies supporting track and source elements within the video. (Although, again, not specifically mentioned.)

Webmention Implementation Reports have a special section on HTML Verification that adds the audio element to the list of “similar links”, which like video can have track and source elements. And it explicitly bans URLs that are just part of text. This latter is not mentioned in the Webmention specification either and something implementations might not be doing.

Note that none of these tests are marked with RFC2119 key words.

Maybe every URL provided in a href or src attribute is a mention? That would cover all HTML5 Links and most Embedded content. Though for object elements you would need to check the data attribute.

Would it be helpful to extend the specification somehow to define what is and isn’t expected of Webmention receivers?

Right now it is completely up to the individual implementor to pick and choose, which could lead to some weird compatibility problems. On the other hand, it also allows IndieWeb projects to use URLs detected through microformats parsing without the need for limiting it to specific elements.

Thoughts?

@aaronpk
Copy link
Member

aaronpk commented Oct 5, 2017

This list of attributes from HTML5 lists all tags and attributes that can contain URLs. That is what is meant by "similar links".

@Zegnat
Copy link
Author

Zegnat commented Oct 5, 2017

I think that would be worth mentioning in the spec then. From that table, it seems the following take URLs:

Attribute Elements
action form
cite blockquote, del, ins, q
data object
formaction button, input
href a, area, link, base
manifest html
poster video
src audio, embed, iframe, img, input, script, source, track, video

I do think some of these can be skipped. action and formaction aren’t so much mentioning an external page as they are actively making use of that page in a way. The same goes for manifest. I’m uncertain about base[href], but I lean towards leaving it out (i.e. *[href]:not(base)).

This skips attributes with “more complicated” rules. Two possible special cases that come to mind:

  1. input[type="url"], as the HTML spec constraints the value to “valid absolute URL”.
  2. data-element, as its value syntax “is determined by the microformats or microdata vocabulary in use.” So if either microformats or microdata requires a URL, then that’s what you will find in there.

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

No branches or pull requests

2 participants