(context webhook.Context)
| 236 | } |
| 237 | |
| 238 | func 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 | } |
no test coverage detected