1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-06-22 02:45:27 +02:00

[FeedExpander] support xhtml content / content with child elements (#3598)

* [core] support xhtml content type in FeedExpander

* [FilterBridge] change defaultValue to exampleValue

* [core] support content with child elements in FeedExpander
This commit is contained in:
User123698745
2023-08-04 22:14:08 +02:00
committed by GitHub
parent d32419ffcf
commit 4976cd227e
2 changed files with 11 additions and 2 deletions

View File

@ -308,7 +308,16 @@ abstract class FeedExpander extends BridgeAbstract
$item['author'] = (string)$feedItem->author->name;
}
if (isset($feedItem->content)) {
$item['content'] = (string)$feedItem->content;
$contentChildren = $feedItem->content->children();
if (count($contentChildren) > 0) {
$content = '';
foreach ($contentChildren as $contentChild) {
$content .= $contentChild->asXML();
}
$item['content'] = $content;
} else {
$item['content'] = (string)$feedItem->content;
}
}
//When "link" field is present, URL is more reliable than "id" field