Allow for empty type in NewText
This commit is contained in:
parent
068f61dc2c
commit
4bad8ae99f
2
text.go
2
text.go
@ -13,7 +13,7 @@ type Text interface {
|
||||
func NewText(textType, content string) (Text, error) {
|
||||
switch textType {
|
||||
case "text", "":
|
||||
return &PlainText{Type: "text", Text: content}, nil
|
||||
return &PlainText{Type: textType, Text: content}, nil
|
||||
case "html":
|
||||
return &PlainText{Type: textType, Text: html.EscapeString(content)}, nil
|
||||
case "xhtml":
|
||||
|
Loading…
x
Reference in New Issue
Block a user