Correctly escape strings if needed and check for it

This commit is contained in:
2024-10-16 16:51:39 +02:00
parent c200d5bf73
commit f27116930a
4 changed files with 26 additions and 1 deletions

View File

@@ -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,