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

Use dt-* property from a nested microformat as the value for a parent dt-* property #71

Open
Zegnat opened this issue Oct 29, 2023 · 1 comment

Comments

@Zegnat
Copy link
Member

Zegnat commented Oct 29, 2023

If an element that is being parsed is both a property and a microformat, values are extracted for the property. In spec look for: “if that child element itself has a microformat ("h-*" or backcompat roots) and is a property element”.

I would expect dt- properties to get a value based on a dt- property within the nested microformat.

Change proposal:

  • if that child element itself has a microformat ("h-*" or backcompat roots) and is a property element, add it into the array of values for that property as a { } structure, add to that { } structure:
    • value:
      • if it's a p-* property element, use the first p-name of the h-* child
      • else if it's an e-* property element, re-use its { } structure with existing value: inside.
      • else if it's a u-* property element and the h-* child has a u-url, use the first such u-url
      • else if it's a dt-* property element and the h-* child has a dt-* property of its own, use the first such dt-* property value
      • else use the parsed property value per p-*,u-*,dt-* parsing respectively

(Only the second to last step is new.)

@Zegnat
Copy link
Member Author

Zegnat commented Oct 29, 2023

Example on my website of using a nested h-event microformat on a dt- property (excerpt):

<div class="h-card">
  <p>In 
    <data class="dt-bday h-event">
        <time class="dt-start dt-end" datetime="1991-10-23T20:09:00+01:00">360 days</time>
        <data class="p-location h-card">
            <data class="p-name" value="Ziekenhuis St Jansdal"></data>
            <data class="u-url" value="https://www.stjansdal.nl/patienten-en-bezoekers/locaties/ziekenhuis-st-jansdal-harderwijk"></data>
            <data class="p-street-address" value="Wethouder Jansenlaan 90"></data>
            <data class="p-postal-code" value="3844 DG"></data>
            <data class="p-locality" value="Harderwijk"></data>
            <data class="p-country-name" value="The Netherlands"></data>
        </data>
    </data>
  </p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant