mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-02-10 16:01:33 +00:00
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