Improve backcompat parsing#111
Merged
aaronpk merged 5 commits intomicroformats:masterfrom Apr 27, 2017
Merged
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.
aaronpk
requested changes
Apr 25, 2017
Member
aaronpk
left a comment
There was a problem hiding this comment.
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:
typeis exactly["h-acme-address"]localityshould bemf2
| /** | ||
| * @see http://microformats.org/wiki/microformats2-parsing-issues#uf2_children_on_backcompat_properties | ||
| */ | ||
| public function testMf2ChildrenOnBackcompatProperties() |
Member
There was a problem hiding this comment.
re: this test, see https://chat.indieweb.org/microformats/2017-04-25#t1493156495491000 for a discussion
Member
There was a problem hiding this comment.
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"> |
Member
There was a problem hiding this comment.
Change h-custom to h-acme-some-acme-object to clarify that it's a non-standard property.
aaronpk
approved these changes
Apr 26, 2017
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.