Skip to content
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

Merged
merged 5 commits into from
Apr 27, 2017
Merged

Improve backcompat parsing #111

merged 5 commits into from
Apr 27, 2017

Conversation

gRegorLove
Copy link
Member

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.

Latest version that supports PHP 5.4
Fixes phpunit dependency from including PHP 5.5+ dependencies, which made the PHP 5.4 build fail.
Copy link
Member

@aaronpk aaronpk left a 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 be mf2

/**
* @see http://microformats.org/wiki/microformats2-parsing-issues#uf2_children_on_backcompat_properties
*/
public function testMf2ChildrenOnBackcompatProperties()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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">
Copy link
Member

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.

@aaronpk aaronpk merged commit 037bcfe into microformats:master Apr 27, 2017
@aaronpk aaronpk mentioned this pull request Apr 27, 2017
@gRegorLove gRegorLove deleted the issue45 branch July 8, 2022 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants