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(`