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

Fix implied URL parsing #192

Merged
merged 2 commits into from
Aug 23, 2018
Merged

Fix implied URL parsing #192

merged 2 commits into from
Aug 23, 2018

Conversation

Zegnat
Copy link
Member

@Zegnat Zegnat commented Aug 7, 2018

Fixes #183.

This takes inspiration from how photo parsing is handled. Basically we convert the semi-CSS selectors used in the parsing specification to XPath selectors.

Adds ParseImpliedTest::testNoImpliedUrl based on the case in #183. This should probably be given a better name, but I am drawing blanks.

Fixes ClassicMicroformatsTest::testMixedMf2andMf1Case3. This test was assuming a url property, but it no longer gets it because it has a nested microformat. At least I think this is right… Is it?

Fixes microformats#183. Adds a test based on that issue. Fixes an old test that
accidentally tests for the child microformats case.
@Zegnat Zegnat requested review from aaronpk and gRegorLove August 7, 2018 17:05
Copy link
Member

@gRegorLove gRegorLove left a comment

Choose a reason for hiding this comment

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

Looks good, just the one line-comment.

Mf2/Parser.php Outdated
);
foreach ($xpaths as $xpath) {
$url = $this->xpath->query($xpath, $e);
if ($url->length === 1) {
Copy link
Member

Choose a reason for hiding this comment

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

Only suggested change is if ($url !== false && $url->length === 1)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👍

Copy link
Member

@gRegorLove gRegorLove left a comment

Choose a reason for hiding this comment

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

👍

@aaronpk aaronpk merged commit 3b9e49f into microformats:master Aug 23, 2018
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.

3 participants