-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backcompat child of mf2 root #11
Comments
My interpretation matched that of sknebel so I would lean towards 1A. 1B seems clearly wrong as the I get where 1C is coming from but I feel its definition is confusing. If this rule should exist because
Also see the discussion between @sknebel and myself on IRC. |
So So I think 1A is correct as the spec is worded now. 1B appealed to me at first since it's closer to what the publisher intended, but I think it's reasonable for publishers that are adding/updating to mf2 to be expected to update Other discussions: |
We just encountered this difference in handling between <body class="h-entry">
<div id="page" class="hfeed site wrap">
<h1 class="entry-title"><span class='p-name'>title</span></h1>
other content
<div class="entry-content">
<div class="e-content">this is a test for indieweb post </div> <span class="syn-text">Also on:</span>
<!--syndication links -->
</div>
</div>
</body> Again, completely ignoring the backcompat 1A results in something like (note no properties on the feed, due to there being no mf1 properties, something mf2py currently does wrong) {"items": [
{"type": ["h-entry"],
"properties": {
"name": ["titleother content\nthis is a test for indieweb post Also on:"]
},
"children": [
{
"type": ["h-feed"],
"properties": {} 1B results in "items": [
{
"type": ["h-entry"],
"properties": {
"name": ["title"],
"content": [
{
"html": "this is a test for indieweb post ",
"value": "this is a test for indieweb post"
}
] EDIT: added examples for outputs. |
Again, 1B (ignoring mf1 inside mf2 roots completely) leads to the more usable result. But as laid out in the first post does not seem to match the spec language, which presumably is there for a reason: Can anyone involved in writing the backcompat rules clarify the thoughts behind allowing mf1 nested in mf2? I could not find anything on the old issues pages. I guess that's @tantek @glennjones? I guess this turns into 2 questions:
|
The new mf2py https://github.com/kartikprabhu/mf2py/ should consistently do 1A according to current spec. Checked on above examples. |
Confirming php-mf2 master branch does 1A now as well. Note the second example doesn't imply the h-entry
|
Thanks for the updates @gRegorLove and @kartikprabhu! Since everyone seems on the same page about what the spec says, we have active parser implementers confirming that their parsers match, the wrong test case has been fixed, and a bug against the JS parser has been filed, I'll close this as is. Thanks everyone! |
This question is to clarify what happens when a backcompat class appears as a child of an mf2 root, since both parser behavior and discussions have varying interpretations.
This markup is derived from what I today encountered on https://indieweb.org/events/2017-04-26-homebrew-website-club,
spec reading
from the parsing specification:
While the section for properties explicitly calls out microformats as "h-*" or backcompat roots, the one for children does not, but given the wording I'd still interpret it as meaning the same.
Also, the note backward compatibility details section says that backcompat classes are ignored in mf2 and mf2 classes in mf1 are ignored
meaning a backcompat root can change processing to backcompat, and this is not explicitly limited to properties
parser results
Of the 4 main parsers supporting backcompat, there are 3 different results (unrelated bugs have been removed/ignored):
1A: child object
In what would also be my interpretation, mf2py and microformats-ruby recognize the
adr
class as a backcompat object and, since it doesn't have a property name, turn it into a child of the surrounding h-card:1B: ignore adr
php-mf2 ignores the
adr
and consequently parses the mf2 properties inside it as properties of the surrounding h-card (which is in this case the result the original author probably intended)1C: apply backcompat rules =>as if "p-adr h-adr"
microformats-shiv (or more specifically, microformats-node based on it) seems to apply the backcompat rules for vcard.adr, turning the
adr
into the equivalent ofp-adr h-adr
. This IMHO clearly shouldn't be applied to a MF2 root likeh-card
, but there is an example in the test suite requiring this behavior(?!).(Side note: If the markup is changed from
class="adr"
toclass="p-adr adr"
(backcompat property value instead of child), microformats-shiv, mf2py and microformats-ruby produce the same result as 1C, whereas mf2-php flattens the"adr"
property to a string)Related material
In this issue, @aaronpk says:
and @gRegorLove seems to say that nested mf1 should be ignored.
The text was updated successfully, but these errors were encountered: