mmcdole / gofeed

Parse RSS, Atom and JSON feeds in Go
MIT License
2.51k stars 204 forks source link

Fix handling of RSS content:encoded #223

Closed cristoper closed 4 months ago

cristoper commented 4 months ago

PR #220 introduced a failing test for detecting images in the "content" element. It should instead be testing the "content:encoded" element. But that uncovered an issue with how extensions were being detected (the "content" namespace was being detected as an extension element).

As a more robust way of checking for the "content" namespace, this PR exposes shared.PrefixForNamspace() as a public function so it can be used in the RSS parser. This should also fix PR #211 (and includes @JLugagne's test case from that PR).

Once the fixes to xml:base handling in #222 are merged, this should fix the remaining failing test reported in #210.