Skip to content

Commit d165913

Browse files
committed
fix: 反斜杠反斜杠反斜杠与颜文字
1 parent 78baf27 commit d165913

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cmd/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
const (
10-
Version string = "0.4.20"
10+
Version string = "0.4.21"
1111
)
1212

1313
var VersionCmd = &cobra.Command{

telegram/utils.go

+2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ var (
2323
)
2424

2525
func EscapeMarkdown(text string) string {
26+
text = strings.ReplaceAll(text, "\\", "\\\\")
2627
for _, char := range escapeChars {
2728
text = strings.ReplaceAll(text, char, "\\"+char)
2829
}
2930
return text
31+
// return regexp.MustCompile(`([_\*[\]\(\)~`+"`"+`>#\+\-=|{}\.!])`).ReplaceAllString(text, `\$1`)
3032
}
3133

3234
func ReplaceChars(input string, oldChars []string, newChar string) string {

0 commit comments

Comments
 (0)