diff --git a/text.go b/text.go index 34e31a6..9bd08ad 100644 --- a/text.go +++ b/text.go @@ -2,6 +2,7 @@ package atomfeed import ( "fmt" + "html" ) type Text interface { @@ -11,8 +12,10 @@ type Text interface { func NewText(textType, content string) (Text, error) { switch textType { - case "text", "html": + case "text": return &PlainText{Type: textType, Text: content}, nil + case "html": + return &PlainText{Type: textType, Text: html.EscapeString(content)}, nil case "xhtml": return &XHTMLText{Type: textType, XHTMLDiv: content}, nil case "":