mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Parse Slack links in the attachment pretext
This commit is contained in:
@@ -185,6 +185,12 @@ func CreateWebhookPost(c *Context, channelId, text, overrideUsername, overrideIc
|
||||
attachment["text"] = aText
|
||||
list[i] = attachment
|
||||
}
|
||||
if _, ok := attachment["pretext"]; ok {
|
||||
aText := attachment["pretext"].(string)
|
||||
aText = linkWithTextRegex.ReplaceAllString(aText, "[${2}](${1})")
|
||||
attachment["pretext"] = aText
|
||||
list[i] = attachment
|
||||
}
|
||||
}
|
||||
post.AddProp(key, list)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user