Skip to content

Commit b086f75

Browse files
authored
Merge pull request #2 from aaronpk/issue157
add failing test for excluding the generated data element in rel tag backcompat
2 parents c5f4e91 + 4c61222 commit b086f75

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/Mf2/ClassicMicroformatsTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,25 @@ public function testHEntryRelTag() {
888888
$this->assertContains('wordpress', $output['items'][0]['properties']['category']);
889889
}
890890

891+
public function testHEntryRelTagInContent() {
892+
$input = <<< END
893+
<article class="hentry">
894+
<div class="entry-content">
895+
Entry content should not include the generated <code>data</code> element for rel tag backcompat
896+
<a href="/tag/test" rel="tag">test</a>
897+
</div>
898+
</article>
899+
END;
900+
901+
$parser = new Parser($input);
902+
$output = $parser->parse();
903+
$item = $output['items'][0];
904+
905+
$this->assertEquals(['test'], $item['properties']['category']);
906+
$this->assertEquals('Entry content should not include the generated data element for rel tag backcompat', $item['properties']['content'][0]['value']);
907+
$this->assertEquals('Entry content should not include the generated <code>data</code> element for rel tag backcompat', $item['properties']['content'][0]['html']);
908+
}
909+
891910
/**
892911
* @see https://github.com/indieweb/php-mf2/issues/157
893912
* @see source: http://jg.typepad.com/ciel/2006/02/daniel_bouluds_.html

0 commit comments

Comments
 (0)