microformats/php-mf2

Arrays type and rels should not contain duplicate items

gRegorLove opened this issue · 0 comments

<div class="h-entry h-cite h-entry">
  <a href="#" rel="me bookmark me"></a>
</div>

Currently parses:

{
    "items": [
        {
            "type": [
                "h-cite",
                "h-entry",
                "h-entry"
            ],
            "properties": {
                "name": [
                    ""
                ],
                "url": [
                    "#"
                ]
            }
        }
    ],
    "rels": {
        "me": [
            "#",
            "#"
        ],
        "bookmark": [
            "#"
        ]
    },
    "rel-urls": {
        "#": {
            "rels": [
                "me",
                "bookmark",
                "me"
            ]
        }
    },
    "debug": {
        "package": "https://packagist.org/packages/mf2/mf2",
        "version": "v0.4.1",
        "note": [
            "This output was generated from the php-mf2 library available at https://github.com/indieweb/php-mf2",
            "Please file any issues with the parser at https://github.com/indieweb/php-mf2/issues"
        ]
    }
}

Expected output:

{
    "items": [
        {
            "type": [
                "h-cite",
                "h-entry"
            ],
            "properties": {
                "name": [
                    ""
                ],
                "url": [
                    "#"
                ]
            }
        }
    ],
    "rels": {
        "bookmark": [
            "#"
        ]
        "me": [
            "#"
        ]
    },
    "rel-urls": {
        "#": {
            "rels": [
                "bookmark",
                "me"
            ]
        }
    }
}

Per spec update: microformats/microformats2-parsing#30