- [#] Unescape XML in Content

This commit is contained in:
Tong Sun 2021-07-24 17:40:54 -04:00
parent d5fc8bbbd9
commit f010d60991

View File

@ -5,8 +5,10 @@ import (
"encoding/xml" "encoding/xml"
"errors" "errors"
"fmt" "fmt"
"html"
"net/http" "net/http"
"os" "os"
"regexp"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
@ -326,6 +328,9 @@ func (m *Message) init(bot *Bot) {
} }
} }
} }
if regexp.MustCompile(`^<`).MatchString(m.Content) {
m.Content = html.UnescapeString(m.Content)
}
} }
// 发送消息的结构体 // 发送消息的结构体