FILE / ScuroNeko/Laniakea

tgfmt/utils.go

Исходный файл и его история в репозитории.
FILE v1.0.1
Files
Laniakea/tgfmt/utils.go
T
ScuroNeko 7205b21fa2
Golang lint / lint (pull_request) Successful in 7m10s
Golang lint / lint (push) Successful in 7m13s
(new): tgfmt package
(fix): formatting helpers
(ci/cd): go checks
(tests): tgfmt coverage
2026-05-04 11:20:09 +03:00

13 lines
281 B
Go

package tgfmt
import "strings"
// EscapePunctuation escapes '.', '!' and '-' for MarkdownV2 fragments.
func EscapePunctuation(s string) string {
symbols := []string{".", "!", "-"}
for _, symbol := range symbols {
s = strings.ReplaceAll(s, symbol, "\\"+symbol)
}
return s
}