Skip to content

Commit

Permalink
Removed: CDATA tags from RSS feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
kabukky committed May 7, 2015
1 parent b26189e commit 694508b
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions templates/rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ func ShowAuthorRss(writer http.ResponseWriter, slug string) error {
func createFeed(values *structure.RequestData) *feeds.Feed {
now := time.Now()
feed := &feeds.Feed{
Title: string(makeCdata(values.Blog.Title)),
Description: string(makeCdata(values.Blog.Description)),
Title: string(values.Blog.Title),
Description: string(values.Blog.Description),
Link: &feeds.Link{Href: string(values.Blog.Url)},
Created: now,
}
Expand All @@ -79,8 +79,8 @@ func createFeed(values *structure.RequestData) *feeds.Feed {
buffer.WriteString("/")
buffer.WriteString(values.Posts[i].Slug)
feed.Items = append(feed.Items, &feeds.Item{
Title: string(makeCdata(values.Posts[i].Title)),
Description: string(makeCdata(values.Posts[i].Html)),
Title: string(values.Posts[i].Title),
Description: string(values.Posts[i].Html),
Link: &feeds.Link{Href: buffer.String()},
Id: string(values.Posts[i].Uuid),
Author: &feeds.Author{Name: string(values.Posts[i].Author.Name), Email: ""},
Expand All @@ -91,11 +91,3 @@ func createFeed(values *structure.RequestData) *feeds.Feed {

return feed
}

func makeCdata(input []byte) []byte {
var buffer bytes.Buffer
buffer.WriteString("<![CDATA[")
buffer.Write(input)
buffer.WriteString("]]>")
return buffer.Bytes()
}

1 comment on commit 694508b

@kabukky
Copy link
Owner Author

@kabukky kabukky commented on 694508b May 7, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #9
Ref #31

Please sign in to comment.