mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 15:19:55 +03: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:
parent
d32419ffcf
commit
4976cd227e
2 changed files with 11 additions and 2 deletions
|
@ -12,7 +12,7 @@ class FilterBridge extends FeedExpander
|
|||
'url' => [
|
||||
'name' => 'Feed URL',
|
||||
'type' => 'text',
|
||||
'defaultValue' => 'https://lorem-rss.herokuapp.com/feed?unit=day',
|
||||
'exampleValue' => 'https://lorem-rss.herokuapp.com/feed?unit=day',
|
||||
'required' => true,
|
||||
],
|
||||
'filter' => [
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue