From 46fb2c5e39f11dd12b6354755b36894ff538fb7b Mon Sep 17 00:00:00 2001 From: zuoban <1061669148@qq.com> Date: Sat, 14 Sep 2024 05:12:25 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=B7=BB=E5=8A=A0=20xml=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E8=BD=AC=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/utils.go b/utils/utils.go index 05852e4..c434520 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -10,6 +10,7 @@ import ( "fmt" "github.com/google/uuid" "github.com/sirupsen/logrus" + "html" "io" "net/http" "net/url" @@ -159,6 +160,8 @@ func GetVoice(text, voiceName, rate, pitch, outputFormat string) ([]byte, error) // GetSsml 生成 SSML 格式的文本 func GetSsml(text, voiceName, rate, pitch string) string { + // 对文本进行转义 + text = html.EscapeString(text) return fmt.Sprintf(`