Skip to content

Empty alt text is overriding h-card name and value #400

Open
@benjifs

Description

@benjifs

I believe following the rules for parsing for implied properties an empty alt text value should not be overriding the name or value of the h-card in this case.

<article class="h-entry">
   <a href="https://example.com" class="p-author h-card">
   Example
   <img src="https://example.com/image.jpeg" class="u-photo" alt="">
   </a>
</article>

Output from https://microformats.github.io/microformats-parser/:

{
  "items": [
    {
      "type": [ "h-entry" ],
      "properties": {
        "author": [
          {
            "type": [ "h-card" ],
            "properties": {
              "photo": [ "https://example.com/image.jpeg" ],
              "name": [ "" ]
            },
            "value": ""
          }
        ],
        "photo": [ "https://example.com/image.jpeg" ]
      }
    }
  ]
}

Expected output as seen in python and PHP parsers:

{
 "items": [
  {
   "type": [ "h-entry" ],
   "properties": {
    "author": [
     {
      "type": [ "h-card" ],
      "properties": {
       "photo": [{
         "value": "https://example.com/image.jpeg",
         "alt": ""
        }],
       "name": [ "Example" ]
      },
      "value": "Example"
     }
    ]
   }
  }
 ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions