This PR is a follow up from #109 that I uncovered while testing. Adds the appropriate structures to output JSON files when parsing an img element with alt and src attributes.
if no explicit "photo" property, and no other explicit u-* properties, and no nested microformats,
then imply by:
if img.h-x[src], then use the result of "parse an img element for src and alt" (see Sec.1.5) for photo
else if object.h-x[data] then use data for photo
else if .h-x>img[src]:only-of-type:not[.h-*] then use the result of "parse an img element for src and alt" (see Sec.1.5) for photo
else if .h-x>object[data]:only-of-type:not[.h-*] then use that object’s data for photo
else if .h-x>:only-child:not[.h-*]>img[src]:only-of-type:not[.h-*], then use the result of "parse an img element for src and alt" (see Sec.1.5) for photo
else if .h-x>:only-child:not[.h-*]>object[data]:only-of-type:not[.h-*], then use that object’s data for photo
if there is a gotten photo value, return the normalized absolute URL of it, following the containing document's language's rules for resolving relative URLs (e.g. in HTML, use the current URL context as determined by the page, and first <base> element, if any).
This PR is a follow up from #109 that I uncovered while testing. Adds the appropriate structures to output JSON files when parsing an
img
element withalt
andsrc
attributes.See Section 1.5 of the microformats2 parsing specification. The changed files reflect the parsing rules for implied photos which reference Section 1.5.
Quote below, emphasis added: