From 97450762dbb8323756d0f52cc7b59b86d0319b97 Mon Sep 17 00:00:00 2001 From: thoemy Date: Thu, 12 May 2016 14:30:44 +0200 Subject: Fix parsing attachment field links into markdown (#2958) (#2959) Field contents are stored in 'value' not 'text'. --- api/post.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index ac499e615..734cb7148 100644 --- a/api/post.go +++ b/api/post.go @@ -200,10 +200,10 @@ func CreateWebhookPost(c *Context, channelId, text, overrideUsername, overrideIc // parse attachment field links into Markdown format for j, fInt := range fields { field := fInt.(map[string]interface{}) - if _, ok := field["text"]; ok { - fText := field["text"].(string) - fText = linkWithTextRegex.ReplaceAllString(fText, "[${2}](${1})") - field["text"] = fText + if _, ok := field["value"]; ok { + fValue := field["value"].(string) + fValue = linkWithTextRegex.ReplaceAllString(fValue, "[${2}](${1})") + field["value"] = fValue fields[j] = field } } -- cgit v1.2.3-1-g7c22