MCPcopy Create free account
hub / github.com/bytebase/bytebase / getMarkdownText

Function getMarkdownText

backend/plugin/webhook/dingtalk/dingtalk.go:238–252  ·  view source on GitHub ↗
(context webhook.Context)

Source from the content-addressed store, hash-verified

236}
237
238func getMarkdownText(context webhook.Context) string {
239 var metaStrList []string
240 for _, meta := range context.GetMetaListZh() {
241 metaStrList = append(metaStrList, fmt.Sprintf("##### **%s:** %s", meta.Name, meta.Value))
242 }
243 if context.ActorName != "" {
244 metaStrList = append(metaStrList, fmt.Sprintf("##### **由:** %s (%s)", context.ActorName, context.ActorEmail))
245 }
246
247 text := fmt.Sprintf("# %s\n%s\n##### [在 Bytebase 中显示](%s)", context.TitleZh, strings.Join(metaStrList, "\n"), context.Link)
248 if context.Description != "" {
249 text = fmt.Sprintf("# %s\n> %s\n%s\n##### [在 Bytebase 中显示](%s)", context.TitleZh, context.Description, strings.Join(metaStrList, "\n"), context.Link)
250 }
251 return text
252}

Callers 2

sendDirectMessageFunction · 0.85
sendMessageFunction · 0.85

Calls 2

GetMetaListZhMethod · 0.80
JoinMethod · 0.80

Tested by

no test coverage detected