MCPcopy Create free account
hub / github.com/gogs/gogs / SlackTextFormatter

Function SlackTextFormatter

internal/database/webhook_slack.go:49–55  ·  view source on GitHub ↗

see: https://api.slack.com/docs/formatting

(s string)

Source from the content-addressed store, hash-verified

47
48// see: https://api.slack.com/docs/formatting
49func SlackTextFormatter(s string) string {
50 // replace & < >
51 s = strings.ReplaceAll(s, "&", "&amp;")
52 s = strings.ReplaceAll(s, "<", "&lt;")
53 s = strings.ReplaceAll(s, ">", "&gt;")
54 return s
55}
56
57func SlackShortTextFormatter(s string) string {
58 s = strings.Split(s, "\n")[0]

Callers 5

SlackLinkFormatterFunction · 0.85
getSlackPushPayloadFunction · 0.85
getSlackIssuesPayloadFunction · 0.85

Calls 1

ReplaceAllMethod · 0.80

Tested by

no test coverage detected