mirror of https://github.com/go-gitea/gitea.git
Create at most just 1 substring when splitting
This commit is contained in:
parent
3cc4fd6564
commit
0983b27d0d
|
@ -156,7 +156,7 @@ func (d discordConvertor) Push(p *api.PushPayload) (DiscordPayload, error) {
|
|||
// for each commit, generate attachment text
|
||||
for i, commit := range p.Commits {
|
||||
// limit the commit message display to just the summary, otherwise it would be hard to read
|
||||
message := strings.TrimRight(strings.Split(commit.Message, "\n")[0], "\r")
|
||||
message := strings.TrimRight(strings.SplitN(commit.Message, "\n", 1)[0], "\r")
|
||||
|
||||
// a limit of 50 is set because GitHub does the same
|
||||
if utf8.RuneCountInString(message) > 50 {
|
||||
|
|
Loading…
Reference in New Issue