microformats / microformats2-parsing

For collecting and handling issues with the microformats2 parsing specification: http://microformats.org/wiki/microformats2-parsing
14 stars 6 forks source link

Include sizes attribute when parsing rel microformats. #39

Open Zegnat opened 6 years ago

Zegnat commented 6 years ago

When parsing a hyperlink element for rel microformats a number of possible attributes are added to the resulting object: hreflang, media, title, and type. This covers a lot of the possible attributes on <link> elements, especially those holding important meta data about the resource.

One attribute that is missing from this list is sizes. This becomes especially important when looking at rel="icon". When I was doing a survey on logo metadata for IndieAuth clients a microformats2 parser would simply tell me it had found 3 rel="icon" links on indielogin.com. It would be impossible to select the right one without the sizes data.

Proposed spec change:

With the current list of attributes to check under:

  • add keys to the hash of the key with name url for each of these attributes (if present) and key not already set:

Add the sub item:

  • "sizes": the value of the "sizes" attribute
Zegnat commented 6 years ago

There was some discussion about this issue in the chat, starting here (my response the next day). This concerned the use of rel="icon" in combination with IndieAuth client information discovery. I want to make clear that this issue is purely about the usefulness of the rel parser, separate of whatever way IndieAuth chooses to go.

And as @kevinmarks said:

Not only are we seeing the attribute in the wild, it is a clearly defined in the HTML spec now (which it probably wasn’t back when the first list of attributes was decided on). It is also important because the output of the rel parser for pages publishing multiple rel="icon"s becomes useless when they are only differentiable by the (missing) sizes attribute.

My reasoning is much as described by @sknebel:

I hope that clears things up!