#microformats 2015-11-24

2015-11-24 UTC
KartikPrabhu, andicascadesf and tantek joined the channel
#
@awoods
@itsananderson Turns out that you are correct. It’s scraping the page using microformats. It just found the wrong micro format first
(twitter.com/_/status/668983984345321472)
tantek, hober, tantek_, KartikPrabhu, gRegorLove, eschnou, glennjones and adactio joined the channel
Erkan_Yilmaz, KartikPrabhu and hober joined the channel
tantek, gRegorLove and adactio joined the channel
elux and Calli joined the channel
#
Calli
Hello. Does anyone know which MF parsers implement this rule as specced: "parse element class for root class name(s) "h-*" and if none, backcompat root classes"
#
Calli
trying to see if there is concensus in current implementations
#
Calli
my (closed-source) implementation currently does compat as a pre-step by adding MF2 classes before doing MF2 parsing
#
Calli
but if element has vcard and h-not-card, I currently treat it as h-card
#
Calli
spec seems to suggest that MF2 parser should ignore the vcard because of presence of h-not-card
#
kylewm
Calli: I can confirm the php and python parsers have backcompat parsing (that works just like you mention)
#
kylewm
The python one does not yet ignore vcard when h-* is present
TallTed joined the channel
#
Calli
Similarly spec says that a compat root should only have compat properties added to it (but child h- elements do get added to a compat root which seems inconsistent)
#
kylewm
yeah we went back and forth on that inconsistent issue a bit. I believe it comes down to being friendly to real world implementations (e.g. wordpress) that have legacy classnames in the base template
#
Calli
I might have to reconsider my approach then (or just test some more and see if it actually matters)
eschnou joined the channel
#
tantek
hi Calli - indeed it is very important to treat backcompat roots differently
#
tantek
we found several issues with directly treating backcompat roots the same as h-* roots
#
tantek
thus the parser was changed accordingly
#
tantek
for example, backcompat roots DO NOT get implied p-name, u-url, or u-photo properties
#
tantek
and you cannot mix backcompat roots with mf2 properties, or mf2 roots with backcompat properties
#
tantek
this is all based on real world experience (e.g. the WordPress examples kylewm mentions), and conservative/defensive specifying to reduce the chance of breaking compat with existing classic mf1 markup
#
Calli
Just to confirm:if I had a document with h-something > vcard > p-name, I'd be expected to drop the p-name on the floor, not add it to the h-something?
#
tantek
rather to rephrase that as a positive
#
tantek
the parsing algorithm does the following
#
tantek
it creats an h-something item upon seeing that mf2 root class
#
tantek
then when parsing and sees the "vcard" class, it creates a backcompat h-card item and adds it to the "children" of the h-something
#
tantek
and then inside the "vcard", it only looks for vcard backcompat class names
#
Calli
Thanks for clarification. My desire for simplicity led me in wrong direction (and a glance at a Python parser confirmed my choice). I can use a single stack for the current item then, but definitely need to track whether item is MF1 or MF2.
eschnou joined the channel
#
tantek
that sounds correct
nitot, Calli, Erkan_Yilmaz, gRegorLove_ and hober joined the channel
#
Calli
Sorry to ask more but in the case of "vcard" > "adr h-adr" > "p-locality" what is the expected output?
nitot and tantek joined the channel
#
tantek
!tell Calli Try constructing some simple span class markup with the tree you gave "vcard" > "adr h-adr" > "p-locality" and using one of the live textarea entry parsers to check! http://microformats.org/wiki/microformats2#Parsers
#
Loqi
Ok, I'll tell them that when I see them next
gRegorLove, andicascadesf, nitot, tantek, gordonb, KartikPrabhu and Calli joined the channel