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

For u- properties, consider parsing the containing tag #57

Open dshanske opened 2 years ago

dshanske commented 2 years ago

Specifically, if a u- property is on an img, video, or audio tag. should this information be parsed into the final JSON? Identifying images, video, and audio seems a common use case and would address people incorrectly using u-photo for this.

gRegorLove commented 2 years ago

What would the proposed parsed result look like for this? What is the use-case that it's solving?

dshanske commented 2 years ago

This would look simialr to https://microformats.org/wiki/microformats2-parsing#parse_an_img_element_for_src_and_alt

https://microformats.org/wiki/microformats2-parsing#parsing_a_u-_property

It notes: else if img.u-x[src] return the result of "parse an img element for src and alt" (see Sec.1.5) else if audio.u-x[src] or video.u-x[src] or source.u-x[src] or iframe.u-x[src], then get the src attribute else if video.u-x[poster], then get the poster attribute

Elsewhere, we proposed if the element has a non-empty id attribute, add the string value of element's id attribute as an id property. So, here this could add 'mime-type': 'image', for example. This would be consistent with srcset and source properties we have yet to decide how to address.

But the practical use case for me is u-featured. Right now, I want to be able to identify that the featured media in an article or otherwise is an image, video, or audio...unless we are limiting u-featured as a draft proposal to images only.

Maybe this is the first use case for the long proposed h-media microformat?