diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-03-18 11:57:46 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-03-18 11:57:46 -0700 |
commit | 6ea4da3bce2cc9321926be74d0cbc6ad0f01f363 (patch) | |
tree | d24eb73c3db3efa992ea8aaafdb5f28f4b286adf /reader/rss/rss.go | |
parent | 34cdffda8878b8d2e37373c55d0bb2ac5993ca1e (diff) |
Handle RSS author elements with inner HTML
Diffstat (limited to 'reader/rss/rss.go')
-rw-r--r-- | reader/rss/rss.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/reader/rss/rss.go b/reader/rss/rss.go index 041cd19..1cd82ba 100644 --- a/reader/rss/rss.go +++ b/reader/rss/rss.go @@ -15,6 +15,7 @@ import ( "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/reader/date" + "github.com/miniflux/miniflux/reader/sanitizer" "github.com/miniflux/miniflux/url" ) @@ -56,6 +57,7 @@ type rssAuthor struct { XMLName xml.Name Data string `xml:",chardata"` Name string `xml:"name"` + Inner string `xml:",innerxml"` } type rssEnclosure struct { @@ -100,7 +102,7 @@ func (r *rssFeed) Transform() *model.Feed { if entry.Author == "" && r.ItunesAuthor != "" { entry.Author = r.ItunesAuthor } - entry.Author = strings.TrimSpace(entry.Author) + entry.Author = strings.TrimSpace(sanitizer.StripTags(entry.Author)) if entry.URL == "" { entry.URL = feed.SiteURL @@ -146,8 +148,8 @@ func (r *rssItem) GetAuthor() string { return element.Name } - if element.Data != "" { - return element.Data + if element.Inner != "" { + return element.Inner } } |