(new): tgfmt package
Golang lint / lint (pull_request) Successful in 7m10s
Golang lint / lint (push) Successful in 7m13s

(fix): formatting helpers
(ci/cd): go checks
(tests): tgfmt coverage
This commit is contained in:
2026-05-04 11:20:09 +03:00
parent 6595265cb3
commit 7205b21fa2
18 changed files with 532 additions and 155 deletions
+12
View File
@@ -0,0 +1,12 @@
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
}