Skip to content

Commit

Permalink
Merge acd6afc into 0fb0825
Browse files Browse the repository at this point in the history
  • Loading branch information
fansanelli committed Mar 23, 2020
2 parents 0fb0825 + acd6afc commit 88b7b1e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Reader/Extension/Atom/Entry.php
Expand Up @@ -142,7 +142,7 @@ protected function collectXhtml($xhtml, $prefix)
$prefix = $prefix . ':';
}
$matches = [
'/<\?xml[^<]*>[^<]*<' . $prefix . 'div[^<]*/',
'/<\?xml[^<]*>[^<]*<' . $prefix . 'div[^>]*>/',
'/<\/' . $prefix . 'div>\s*$/',
];
$xhtml = preg_replace($matches, '', $xhtml);
Expand Down
9 changes: 9 additions & 0 deletions test/Reader/Entry/AtomTest.php
Expand Up @@ -360,6 +360,15 @@ public function testGetsContentFromAtom10XhtmlNamespaced()
$this->assertEquals('<p class="x:"><em>Entry Content &amp;x:</em></p>', $entry->getContent());
}

public function testGetsContentWithoutChildElementsFromAtom10XhtmlNamespaced()
{
$feed = Reader\Reader::importString(
file_get_contents($this->feedSamplePath . '/content/plain/atom10_Xhtml_nochild.xml')
);
$entry = $feed->current();
$this->assertEquals('Entry Content &amp;x:', $entry->getContent());
}

/**
* Get Link (Unencoded Text)
*/
Expand Down
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<entry>
<content type="xhtml" xmlns:x="http://www.w3.org/1999/xhtml">
<x:div>Entry Content &amp;x:</x:div>
</content>
</entry>
</feed>

0 comments on commit 88b7b1e

Please sign in to comment.