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

Don't parse root/property class names with consecutive dashes #160

Closed
gRegorLove opened this issue Mar 21, 2018 · 0 comments
Closed

Don't parse root/property class names with consecutive dashes #160

gRegorLove opened this issue Mar 21, 2018 · 0 comments
Milestone

Comments

@gRegorLove
Copy link
Member

<div class="h-entry h-----">
<p> <a href="http://example.com/post" class="u-in-reply--to">http://example.com/post posted:</a> </p>
<span class="p-name">Too many dashes</span>
<span class="p--acme-leading">leading dash</span>
<span class="p-acme--middle">middle dash</span>
<span class="p-acme-trailing-">trailing dash</span>
</div>

Currently parses:

{
    "items": [
        {
            "type": [
                "h-----",
                "h-entry"
            ],
            "properties": {
                "name": [
                    "Too many dashes"
                ],
                "-acme-leading": [
                    "leading dash"
                ],
                "acme--middle": [
                    "middle dash"
                ],
                "acme-trailing-": [
                    "trailing dash"
                ],
                "in-reply--to": [
                    "http://example.com/post"
                ]
            }
        }
    ],
    "rels": {},
    "rel-urls": {},
    "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 via mf2py dev

{
    "rels": {}, 
    "items": [
        {
            "type": [
                "h-entry"
            ], 
            "properties": {
                "name": [
                    "Too many dashes"
                ]
            }
        }
    ], 
    "rel-urls": {}, 
    "debug": {
        "source": "https://github.com/microformats/mf2py", 
        "version": "1.1.0", 
        "markup parser": "html5lib", 
        "description": "mf2py - microformats2 parser for python"
    }
}

Per spec update: microformats/microformats2-parsing#31

gRegorLove added a commit to gRegorLove/php-mf2 that referenced this issue Mar 22, 2018
@gRegorLove gRegorLove added this to the 0.4.2 milestone Mar 23, 2018
aaronpk added a commit that referenced this issue Mar 25, 2018
Add failing tests and fixes for #158, #160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant