#microformats 2014-11-24

2014-11-24 UTC
KartikPrabhu joined the channel
#
aaronpk
this channel isn't dead, just sleeping
KevinMarks__, ChiefRA, chiui, krendil, KevinMarks, adactio, netweb, eschnou, alanpearce, Musk, voxpelli, benward_____, Garbee, tommorris, bret, iwaim, TallTed, mko, gRegor`, KartikPrabhu and tantek joined the channel
#
tantek
ben_thatmust left me a message earlier today: does this seem to be correct in its parsing? the category and h-card ending up nested seems odd, but looks to be correct for the algo. Want to double check it is correct before i build on it. https://gist.github.com/dissolve/2911540317b48514f4c6
ben_thatmustbeme joined the channel
#
tantek
ben_thatmustbeme: great test case, it's an interesting challenge of both implying property names and minimal parent/child microformats objects
#
tantek
here's a general principle - 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.
#
tantek
thus it's up to the parsing algorithm to be tightened up to prevent that
#
tantek
it looks like mostly this is happening due to implied properties
#
tantek
starting with name
#
tantek
this rule is triggering an extra property/name for the parent " else if .h-x>area:only-child[alt] then use that area alt for name "
#
tantek
in this case, that should only be triggered if the area itself is NOT a microformat
#
tantek
and since <area> can't have children itself, this is relatively easy to test
#
tantek
edited /microformats2-parsing (+40) "/* parsing for implied properties */ fix nested img and area implying a name property to not do so for a parent/ancestor if they themselves are the root of a microformat"
(view diff)
#
tantek
that should fix the extra "Person Bee" on the parent h-entry
#
tantek
(fix as in prevent)
#
mko
Cleaned up the Gist to be easily readable https://gist.github.com/mko/2c481e1bb5d2deb9d2f8
#
tantek
the same problem can also occur to implying a photo via a child img element, which itself is a microformat, thus we should prevent that as well
#
mko
If someone wants to provide what the "result_expected.json" would look like, I can update that as well.
#
tantek
I should say, not "we should prevent", but rather, "we already prevent"
#
tantek
lastly there is the implied url property
#
Loqi
fo sho
#
tantek
which already has the ":not[.h-*]" test in it
#
tantek
e.g. this statement
#
tantek
" else if .h-x>area[href]:only-of-type:not[.h-*] then use that [href] for url "
#
tantek
thus that duplication of property into parent and child is a bug in the parser, not the spec
#
tantek
and with that, I have verified by review that the spec says the right thing
#
tantek
per mko's request
#
tantek
the only changes to go from result_actual to result_expected:
#
tantek
the last "name": ["Person Bee"], should be "name": [""],
#
tantek
and the last "url": ["http://personB.example.com"] should simpliy not be there at all
#
tantek
the "name" fix is the change I just made to the wiki above
#
tantek
the "url" fix should have already worked per the "if .h-x>area[href]:only-of-type:not[.h-*]" rule quoted above
#
mko
ben_thatmustbeme: that was parsed originally via php-mf2, yes?
#
mko
Thanks tantek
#
ben_thatmustbeme
slightly modified php-mf2 I added a bit to put in area support
#
tantek
mko - oops one more fix
#
tantek
the "type" values should all be arrays
#
tantek
e.g. "type": "h-entry", should be "type": ["h-entry"],
#
mko
Oh. Right. That was my bad in translating the PHP object explain
#
tantek
checks the PHP object dump
#
tantek
yup - that's correct in the PHP dump
#
mko
Fixed.
#
tantek
thanks mko. looks good
#
tantek
thanks ben_thatmustbeme - do those spec details make sense to you?
#
tantek
goes to add a note about the general principle noted above
#
tantek
edited /microformats2-parsing (+298) "/* parsing for implied properties */ note about general principle of property markup should not cause that microformat on both a microformat and an embedded child microformat."
(view diff)
#
tantek
ok that should do it. microformats2-parsing updated to handle test case and incorporate essential commentary above.
#
ben_thatmustbeme
yeah, i see that fixing the one issue, need to look up the bug in the parser too
chiui, eschnou, KartikPrabhu and EsoRottica joined the channel
#
ben_thatmustbeme
looks like that bug exists in php-mf2 before, it doesn't check the :not[.h-*
krendil, KartikPrabhu and caseorganic joined the channel
#
ben_thatmustbeme
this looks to have fixed the issue now
#
ben_thatmustbeme
also have that version of php-mf2 up on github
tantek and KevinMarks joined the channel
#
ben_thatmustbeme
i have a feeling there may be other bugs in php-mf2 i'll have to deal with, but for now i sent a pull req to the main trunk. On to the next level in handling tagging
tantek, KartikPrabhu and KevinMarks joined the channel