diff --git a/reader/rss/parser_test.go b/reader/rss/parser_test.go index 1e57a97c..67672127 100644 --- a/reader/rss/parser_test.go +++ b/reader/rss/parser_test.go @@ -355,6 +355,34 @@ func TestParseEntryWithAuthorAndInnerHTML(t *testing.T) { } } +func TestParseEntryWithAuthorAndCDATA(t *testing.T) { + data := ` + + + Example + https://example.org/ + + + Test + https://example.org/item + + by + + + + ` + + feed, err := Parse("https://example.org/", bytes.NewBufferString(data)) + if err != nil { + t.Fatal(err) + } + expected := "by Foo Bar" + result := feed.Entries[0].Author + if result != expected { + t.Errorf("Incorrect entry author, got %q instead of %q", result, expected) + } +} + func TestParseEntryWithNonStandardAtomAuthor(t *testing.T) { data := ` diff --git a/reader/rss/rss.go b/reader/rss/rss.go index 25348039..7324cc5a 100644 --- a/reader/rss/rss.go +++ b/reader/rss/rss.go @@ -217,6 +217,8 @@ func (r *rssItem) entryAuthor() string { default: if rssAuthor.Name != "" { author = rssAuthor.Name + } else if strings.Contains(rssAuthor.Inner, "