Subject: | support for microformats 2 |
Hi Toby,
thanks for creating such a robust microformats handler! I was hoping it would also support microformats 2 (http://microformats.org/wiki/microformats-2) as it's being developed for two years now and is already seen in the wild (http://microformats.org/wiki/microformats-2#Examples_in_the_wild).
But either I'm doing something very wrong or HTML::Microformats does not support (yet) the microformats 2 spec. Here's my sample code:
----------8<----------
use strict;
use warnings;
use HTML::Microformats;
my $doc = HTML::Microformats->new_document(
'<span class="h-card">Frances Berriman</span>',
'http://microformats.org/profile/h-card'
)->assume_profile( 'hCard' );
print $doc->json( pretty => 1 );
---------->8----------
According to their documentation, it is supposed to output this:
{
"items": [{
"type": ["h-card"],
"properties": {
"name": ["Frances Berriman"]
}
}]
}
but instead I get this:
{
"adr" : [],
"hCard" : [],
"geo" : []
}
Maybe I did something stupid, but I'm assuming the hCard format is only for microformats v1, and v2 needs new format handlers, like HTML::Microformats::Format::h_card or something. Or maybe it can be bundled into the original parser, I don't know.
What do you think? Can I has microformats 2? :)
Thanks! And thanks again for such a cool module!