1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-08 14:42:26 +08:00

fix: 序列化 xml 时添加 cdata 标签

This commit is contained in:
陈灿鑫
2019-11-01 23:21:25 +08:00
parent 279ff79406
commit e09031b58c
2 changed files with 18 additions and 10 deletions

View File

@@ -3,12 +3,12 @@ package message
//Text 文本消息
type Text struct {
CommonToken
Content string `xml:"Content"`
Content CDATA `xml:"Content"`
}
//NewText 初始化文本消息
func NewText(content string) *Text {
text := new(Text)
text.Content = content
text.Content = CDATA(content)
return text
}