Skip to content

Commit

Permalink
[FeedExpander] support xhtml content / content with child elements (R…
Browse files Browse the repository at this point in the history
…SS-Bridge#3598)

* [core] support xhtml content type in FeedExpander

* [FilterBridge] change defaultValue to exampleValue

* [core] support content with child elements in FeedExpander
  • Loading branch information
User123698745 authored Aug 4, 2023
1 parent d32419f commit 4976cd2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bridges/FilterBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
11 changes: 10 additions & 1 deletion lib/FeedExpander.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,16 @@ protected function parseATOMItem($feedItem)
$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
Expand Down

0 comments on commit 4976cd2

Please sign in to comment.