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

adding h-* to an e-* property loses the "html:" key #64

Closed
tantek opened this issue May 10, 2015 · 3 comments
Closed

adding h-* to an e-* property loses the "html:" key #64

tantek opened this issue May 10, 2015 · 3 comments

Comments

@tantek
Copy link
Member

tantek commented May 10, 2015

Compare how it parses:

<div class="h-entry"><div class="e-content"><p>Hello</p></div></div>

to how it parses:

<div class="h-entry"><div class="h-card e-content"><p>Hello</p></div></div>

Note that in the second example the "html:" key inside content is lost for no reason.

@tantek
Copy link
Member Author

tantek commented May 10, 2015

Expected result:

{
    "items": [
        {
            "type": [
                "h-entry"
            ],
            "properties": {
                "content": [
                    {
                        "type": [
                            "h-card"
                        ],
                        "properties": {
                            "name": [
                                "Hello"
                            ]
                        },
                        "html": "<p>Hello<\/p>",
                        "value": "Hello"
                    }
                ],
                "name": [
                    "Hello"
                ]
            }
        }
    ],
    "rels": {}
}

@barnabywalters
Copy link
Collaborator

Working on adding this now, where exactly is this made explicit in the parsing spec though? Reading through http://microformats.org/wiki/microformats2-parsing I cannot see where this is specified, unless it was missed out from "else if it's an e-* property element, re-use its { } structure with existing value: inside". Should that line read "else if it's an e-* property element, re-use its { } structure with existing value: and html: inside"

I also find the “re-use it’s {} structure” language here a little problematic. Reading the spec it appears to suggest that parsing <div class="h-entry"><span class="p-author h-card">Author Name</span></div> should result in a h-entry microformat structure with two values for the author property, a string (from the “parse a child element for property class names” step) and also a child microformat (from the “parse a child element for microformats” step). This is of course not the case. I find the parsing spec as it is currently written confusing because of this.

@barnabywalters
Copy link
Collaborator

@tantek out of interest, can you remember if there was a real world example which prompted this? I’d be interested to see if if so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants