mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00: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
@ -12,7 +12,7 @@ class FilterBridge extends FeedExpander
|
|||||||
'url' => [
|
'url' => [
|
||||||
'name' => 'Feed URL',
|
'name' => 'Feed URL',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'defaultValue' => 'https://lorem-rss.herokuapp.com/feed?unit=day',
|
'exampleValue' => 'https://lorem-rss.herokuapp.com/feed?unit=day',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
],
|
],
|
||||||
'filter' => [
|
'filter' => [
|
||||||
|
@ -308,7 +308,16 @@ abstract class FeedExpander extends BridgeAbstract
|
|||||||
$item['author'] = (string)$feedItem->author->name;
|
$item['author'] = (string)$feedItem->author->name;
|
||||||
}
|
}
|
||||||
if (isset($feedItem->content)) {
|
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
|
//When "link" field is present, URL is more reliable than "id" field
|
||||||
|
Loading…
Reference in New Issue
Block a user