parser: properly support tag subtrees instead of text content for article content
This commit is contained in:
@@ -70,6 +70,17 @@ abstract class FeedItem_Common extends FeedItem {
|
||||
}
|
||||
}
|
||||
|
||||
function count_children($node) {
|
||||
return $node->getElementsByTagName("*")->length;
|
||||
}
|
||||
|
||||
function subtree_or_text($node) {
|
||||
if ($this->count_children($node) == 0) {
|
||||
return $node->nodeValue;
|
||||
} else {
|
||||
return $node->c14n();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user