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/parser_test.go | |
parent | 34cdffda8878b8d2e37373c55d0bb2ac5993ca1e (diff) |
Handle RSS author elements with inner HTML
Diffstat (limited to 'reader/rss/parser_test.go')
-rw-r--r-- | reader/rss/parser_test.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/reader/rss/parser_test.go b/reader/rss/parser_test.go index 7bf9f75..6d9015d 100644 --- a/reader/rss/parser_test.go +++ b/reader/rss/parser_test.go @@ -230,6 +230,31 @@ func TestParseFeedURLWithAtomLink(t *testing.T) { } } +func TestParseEntryWithAuthorAndInnerHTML(t *testing.T) { + data := `<?xml version="1.0" encoding="utf-8"?> + <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> + <channel> + <title>Example</title> + <link>https://example.org/</link> + <atom:link href="https://example.org/rss" type="application/rss+xml" rel="self"></atom:link> + <item> + <title>Test</title> + <link>https://example.org/item</link> + <author>by <a itemprop="url" class="author" rel="author" href="/author/foobar">Foo Bar</a></author> + </item> + </channel> + </rss>` + + feed, err := Parse(bytes.NewBufferString(data)) + if err != nil { + t.Error(err) + } + + if feed.Entries[0].Author != "by Foo Bar" { + t.Errorf("Incorrect entry author, got: %s", feed.Entries[0].Author) + } +} + func TestParseEntryWithAtomAuthor(t *testing.T) { data := `<?xml version="1.0" encoding="utf-8"?> <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> |