microformats / tests

Microformats test suite

Home Page:http://microformats.org/wiki/microformats2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implied name, url etc across child h-* boundaries

glennjones opened this issue · comments

I have a complex issue with:

http://testrunner-47055.onmodulus.net/test/microformats-v2/h-entry/impliedvalue-nested/

Within the test HTML the only child of the h-entry element is a div with a h-cite.

The question is should the "implied name" and "implied url" ever cross the h-cite boundaries to a get a value from within this child. I believe the parsing rules say no.

From the wiki implied parsing rules
"Note: The same markup for a property should not be causing that property to occur in both a microformat and one embedded inside - such a property should only be showing up on one of them. The parsing algorithm has details to prevent that, such as the :not[.h-*] tests above."

At the moment the test shows that:

  1. "implied name" does cross the h-cite boundaries because its doing a textContent of the all the h-entry element HTML.
  2. "implied url" returns nothing as it understands it cannot use the URL it finds because its inside a child microformat

To correct this I would have remove the h-cite DOM element before doing the textContent. The result would be that no name was return because h-cite DOM element is the only child.

ie

{
    "items": [{
        "type": ["h-entry"],
        "properties": {
            "in-reply-to": [{
                "type": ["h-cite"],
                "properties": {
                    "name": ["Example Post"],
                    "url": ["http://example.com/post"],
                    "author": [{
                        "type": ["h-card"],
                        "properties": {
                            "url": ["http://example.com"],
                            "name": ["Example Author"]
                        },
                        "value": "Example Author"
                    }]
                },
                "value": "http://example.com/post"
            }]
        }
    }],
    "rels": {},
    "rel-urls": {}
}

This sounds like the right thing is already happening.

Note that the point about not-crossing applies specifically to "markup for a property".

In all "implied" scenarios you mention - there is no markup for the property - that's why it's being implied.

Thanks for the feedback Tantek - think the tests are now update with parsing rules as they stand