-
Notifications
You must be signed in to change notification settings - Fork 38
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
Improve backcompat parsing #111
Conversation
Latest version that supports PHP 5.4
Fixes phpunit dependency from including PHP 5.5+ dependencies, which made the PHP 5.4 build fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a test for the simpler backcompat case of:
<span class="adr h-acme-address">
<span class="locality">mf1</span>
<span class="p-locality">mf2</span>
</span>
with tests for:
type
is exactly["h-acme-address"]
locality
should bemf2
/** | ||
* @see http://microformats.org/wiki/microformats2-parsing-issues#uf2_children_on_backcompat_properties | ||
*/ | ||
public function testMf2ChildrenOnBackcompatProperties() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: this test, see https://chat.indieweb.org/microformats/2017-04-25#t1493156495491000 for a discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like the resolution is that in this test, the adr
should not be added as a type
of the h-card
. This will require some changes to the parser, and we also need a test here to check that type
correctly has only one value.
public function testMf2ChildrenOnBackcompatProperties() | ||
{ | ||
$input = '<div class="vcard"> | ||
<div class="adr h-custom"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change h-custom
to h-acme-some-acme-object
to clarify that it's a non-standard property.
Follows the backcompat algorithm better by going recursively through the elements and keeping track of whether currently inside an mf1 or mf2 root. Fixes #45 and #107.