Skip to content

Commit

Permalink
Parse RSS item elements too if they are outside of the channel element
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitot committed Dec 5, 2024
1 parent 50a72b3 commit 06fe217
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Vienna/Sources/Parsing/RSSFeed.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ - (BOOL)initRSSFeed:(NSXMLElement *)rssElement isRDF:(BOOL)isRDF
success = [self initRSSFeedItems:rssElement];
} else {
success = [self initRSSFeedItems:channelElement];

// Previous versions of RSS allowed <item> elements under the <rss>
// element instead of the <channel> element. If no items were found
// under the <channel> element then traverse the <rss> element too.
if (self.items.count == 0) {
success = [self initRSSFeedItems:rssElement];
}
}
}
return success;
Expand Down

0 comments on commit 06fe217

Please sign in to comment.