Create correct xhtml constructs
This commit is contained in:
8
text.go
8
text.go
@@ -17,7 +17,13 @@ func NewText(textType, content string) (Text, error) {
|
||||
case "html":
|
||||
return &PlainText{Type: textType, Text: html.EscapeString(content)}, nil
|
||||
case "xhtml":
|
||||
return &XHTMLText{Type: textType, XHTMLDiv: content}, nil
|
||||
return &XHTMLText{
|
||||
Type: textType,
|
||||
XHTMLDiv: XHTMLDiv{
|
||||
XMLNS: "http://www.w3.org/1999/xhtml",
|
||||
Content: content,
|
||||
},
|
||||
}, nil
|
||||
case "":
|
||||
return &PlainText{Type: "text", Text: content}, nil
|
||||
default:
|
||||
|
Reference in New Issue
Block a user