microformats / php-mf2

php-mf2 is a pure, generic microformats-2 parser for PHP. It makes HTML as easy to consume as JSON.
Creative Commons Zero v1.0 Universal
194 stars 38 forks source link

mf2 properties inside mf1 root to be ignored #145

Closed kartikprabhu closed 6 years ago

kartikprabhu commented 6 years ago

According to spec http://microformats.org/wiki/microformats2-parsing#note_backward_compatibility_details any mf2 properties inside a mf1 root should be ignored.

HTML

<div class="hentry">
    <span class="p-name">Wrong name</span>
    <span class="entry-title">Correct name</span>

    <span class="p-summary">Wrong summary</span>
    <span class="entry-summary">Correct summary</span>
</div>

Current output from pin13

"items": [
        {
            "type": [
                "h-entry"
            ],
            "properties": {
                "name": [
                    "Wrong name",
                    "Correct name"
                ],
                "summary": [
                    "Wrong summary",
                    "Correct summary"
                ]
            }
        }
    ]

Expected output

"items": [
        {
            "type": [
                "h-entry"
            ],
            "properties": {
                "name": [
                    "Correct name"
                ],
                "summary": [
                    "Correct summary"
                ]
            }
        }
    ]
aaronpk commented 6 years ago

This is fixed in the current master branch. https://pin13.net/mf2-dev/?id=20180310151320713

kartikprabhu commented 6 years ago

lgtm should have checked that first