From 4bad8ae99f39abff77de4b3ad51112b19d47c849 Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Tue, 15 Oct 2024 20:09:18 +0200 Subject: [PATCH] Allow for empty type in NewText --- text.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text.go b/text.go index 0f67192..221ba7c 100644 --- a/text.go +++ b/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":