diff --git a/message.go b/message.go index 702b4cd..a94b269 100644 --- a/message.go +++ b/message.go @@ -5,8 +5,10 @@ import ( "encoding/xml" "errors" "fmt" + "html" "net/http" "os" + "regexp" "strconv" "strings" "sync" @@ -326,6 +328,13 @@ func (m *Message) init(bot *Bot) { } } } + if regexp.MustCompile(`^<`).MatchString(m.Content) { + m.Content = html.UnescapeString(m.Content) + } + //if m.IsText() + { + m.Content = strings.Replace(m.Content, `
`, "\n", -1) + } } // 发送消息的结构体