wangshan 10 сар өмнө
parent
commit
0f711db842

+ 5 - 0
src/jfw/modules/weixin/src/wx/reply.go

@@ -4,10 +4,12 @@ import (
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/redis"
 	"fmt"
+	"html"
 	"jy/src/jfw/modules/weixin/src/github.com/wizjin/weixin"
 	"jy/src/jfw/modules/weixin/src/tools"
 	"log"
 	"regexp"
+	"strings"
 )
 
 const (
@@ -49,6 +51,9 @@ WHERE
 		desc := common.ObjToString((*rs)[i]["desc"])
 		switch reply_type {
 		case ReplyContentTEXT:
+			//编码及换行处理
+			title = html.UnescapeString(title)
+			title = strings.ReplaceAll(strings.ReplaceAll(title, "<br />", "\n"), "\\n", "\n")
 			// 使用正则表达式匹配HTML标签
 			re, err := regexp.Compile("\\<[^a]+?\\>")
 			if err != nil {