Skip to content

Fix backcompat parsing for geo property #195

Closed
@gRegorLove

Description

@gRegorLove

With this test, when the geo property is backcompat parsed as p-geo h-geo, the parser is incorrectly adding an implied p-name for the h-geo.

Simplified HTML:

<div class="vcard">
  <div class="fn">John Doe</div>
  <div>Location: <abbr class="geo" title="30.267991;-97.739568">Brighton</abbr></div>
</div>

parsed:

"items": [
    {
        "type": [
            "h-card"
        ],
        "properties": {
            "name": [
                "John Doe"
            ],
            "geo": [
                {
                    "type": [
                        "h-geo"
                    ],
                    "properties": {
                        "name": [
                            "30.267991;-97.739568"
                        ]
                    },
                    "value": "30.267991;-97.739568"
                }
            ]
        }
    }
]

expected:

"items": [
    {
        "type": [
            "h-card"
        ],
        "properties": {
            "name": [
                "John Doe"
            ],
            "geo": [
                {
                    "type": [
                        "h-geo"
                    ],
                    "properties": {},
                    "value": "30.267991;-97.739568"
                }
            ]
        }
    }
]

I think this switch needs a case for geo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions