Correctly escape strings if needed and check for it
This commit is contained in:
2
text.go
2
text.go
@@ -15,7 +15,7 @@ func NewText(textType, content string) (Text, error) {
|
||||
case "text", "":
|
||||
return &PlainText{Type: textType, Text: content}, nil
|
||||
case "html":
|
||||
return &PlainText{Type: textType, Text: html.EscapeString(content)}, nil
|
||||
return &PlainText{Type: textType, Text: html.UnescapeString(content)}, nil
|
||||
case "xhtml":
|
||||
return &XHTMLText{
|
||||
Type: textType,
|
||||
|
Reference in New Issue
Block a user