Skip to content

Commit

Permalink
Merge pull request #56 from alexdebril/issue/55
Browse files Browse the repository at this point in the history
issue #55 CDATA support
  • Loading branch information
alexdebril authored Nov 18, 2016
2 parents 57f811a + 2550af7 commit 1d58fd2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/FeedIo/Rule/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ class Description extends RuleAbstract
public function setProperty(NodeInterface $node, \DOMElement $element)
{
$string = '';
foreach($element->childNodes as $childNode) {
$string .= $element->ownerDocument->saveXML($childNode);
if ( $element->firstChild->nodeType == XML_CDATA_SECTION_NODE ) {
$string = $element->firstChild->textContent;
} else {
foreach($element->childNodes as $childNode) {
$string .= $element->ownerDocument->saveXML($childNode);
}
}

$node->setDescription($string);
Expand Down

0 comments on commit 1d58fd2

Please sign in to comment.