Open kartikprabhu opened 6 years ago
Proposal for properties that need to be nested in other things for backcompat maybe use the following example from hreview["url"]
"url": [
"p-item",
"h-item",
"u-url"
]
"url": [
{
"parent": [
"p-item",
"h-item"
],
"self": [
"u-url"
]
}
]
Alternative:
type
instead of parent
and use properties
instead of self
keyscc: @gregorlove @kevinmarks @tantek thoughts/suggestions ?
The question is how much of the existing hreview content is using the non-nested markup.
@kevinmarks yes @gregorlove I think is sorting through the examples in the wild. I am going to wait on this.
However there are also other funny rules http://microformats.org/wiki/h-review#Parser_Compatibility that are not represented. Mainly the ones about item
. item
is parsed differently depending on whether it comes alone or along with vcard
or hproduct
or vevent
. Also the h-item
rule only applies inside a hreview
that is item
is not its own microformat but only makes sense inside hreview
.
I have not found hReviews with fn
, url
, or photo
properties without an intervening item
yet. I also haven't tracked down in which version of the hReview specification that was ever shown as a valid way to author hReview. The only mention seems to be in the h-review parser compatibility section.
@kartikprabhu: php-mf2 currently treats the various hReview.item
backcompats with simple class replacement. As far as I know it's working well, so the general format you've set in this repo should work.
@gRegorLove how does php-mf2 then distinguish between item
and item vevent
?
The item x
variants are special cased before the base class replacements are done: https://github.com/indieweb/php-mf2/blob/master/Mf2/Parser.php#L1528
related discussion: https://chat.indieweb.org/microformats/2018-03-19#t1521484129193800
According to http://microformats.org/wiki/h-review#Parser_Compatibility
hreview
backcompat should check for bothself
andbookmark
inrel
.And all the weird
item
rules