Commit 9a5464e0 authored by Aaron Parecki's avatar Aaron Parecki

Merge pull request #71 from gRegorLove/issue70

Attempting to fix #70
parents a4d44507 0457e67a
...@@ -691,7 +691,7 @@ class Parser { ...@@ -691,7 +691,7 @@ class Parser {
$prefixSpecificResult['html'] = $eParsedResult['html']; $prefixSpecificResult['html'] = $eParsedResult['html'];
$prefixSpecificResult['value'] = $eParsedResult['value']; $prefixSpecificResult['value'] = $eParsedResult['value'];
} elseif (in_array('u-', $prefixes)) { } elseif (in_array('u-', $prefixes)) {
$prefixSpecificResult['value'] = $this->parseU($subMF); $prefixSpecificResult['value'] = (empty($result['properties']['url'])) ? $this->parseU($subMF) : reset($result['properties']['url']);
} }
$return[$property][] = $prefixSpecificResult; $return[$property][] = $prefixSpecificResult;
} }
......
...@@ -284,12 +284,13 @@ class CombinedMicroformatsTest extends PHPUnit_Framework_TestCase { ...@@ -284,12 +284,13 @@ class CombinedMicroformatsTest extends PHPUnit_Framework_TestCase {
}] }]
} }
}], }],
"rels":{} "rels":[]
}'; }';
$parser = new Parser($input, '', true); $mf = Mf2\parse($input);
$output = $parser->parse();
$this->assertJsonStringEqualsJsonString(json_encode($output), $expected); $this->assertJsonStringEqualsJsonString(json_encode($mf), $expected);
$this->assertEquals($mf['items'][0]['properties']['comment'][0]['value'], 'http://example.org/post1234');
$this->assertEquals($mf['items'][0]['properties']['comment'][0]['properties']['author'][0]['value'], 'http://jane.example.com/');
} }
public function testMicroformatsNestedUnderPPropertyClassnamesDeriveValueFromFirstPName() { public function testMicroformatsNestedUnderPPropertyClassnamesDeriveValueFromFirstPName() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment