Allow for empty type in NewText

This commit is contained in:
Jason Streifling 2024-10-15 20:09:18 +02:00
parent 068f61dc2c
commit 4bad8ae99f

View File

@ -13,7 +13,7 @@ type Text interface {
func NewText(textType, content string) (Text, error) { func NewText(textType, content string) (Text, error) {
switch textType { switch textType {
case "text", "": case "text", "":
return &PlainText{Type: "text", Text: content}, nil return &PlainText{Type: textType, Text: content}, nil
case "html": case "html":
return &PlainText{Type: textType, Text: html.EscapeString(content)}, nil return &PlainText{Type: textType, Text: html.EscapeString(content)}, nil
case "xhtml": case "xhtml":