diff --git a/reader/atom/atom_10.go b/reader/atom/atom_10.go index cad011ae..71e7c697 100644 --- a/reader/atom/atom_10.go +++ b/reader/atom/atom_10.go @@ -229,10 +229,9 @@ type atom10Text struct { func (a *atom10Text) String() string { var content string - switch { case a.Type == "", a.Type == "text", a.Type == "text/plain": - if strings.HasPrefix(a.InnerXML, `Some text. + + + <![CDATA[Entry title with space around CDATA]]> + + + urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a + 2003-12-13T18:30:02Z + Some text. + + ` feed, err := Parse("https://example.org/", bytes.NewBufferString(data)) @@ -317,6 +327,10 @@ func TestParseEntryWithHTMLTitle(t *testing.T) { if feed.Entries[1].Title != "Test “Test”" { t.Errorf("Incorrect entry title, got: %q", feed.Entries[1].Title) } + + if feed.Entries[2].Title != "Entry title with space around CDATA" { + t.Errorf("Incorrect entry title, got: %q", feed.Entries[2].Title) + } } func TestParseEntryWithXHTMLTitle(t *testing.T) {