|
@@ -936,6 +936,8 @@ func ExtractText(body string) (result string, err error) {
|
|
|
|
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 富文本字符串截取指定长度
|
|
func InterceptHtmlLength(body string, length int) (newbody string) {
|
|
func InterceptHtmlLength(body string, length int) (newbody string) {
|
|
content := html.UnescapeString(body)
|
|
content := html.UnescapeString(body)
|
|
doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
|
|
doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
|