diff options
author | thoemy <thoemy@gmx.net> | 2016-05-12 14:30:44 +0200 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-12 08:30:44 -0400 |
commit | 3f0325fd223dcb3a6eec92f772df1e7541ab0b2b (patch) | |
tree | c01866274ff7e4ce665395373d4227678b44759c /api | |
parent | 4b260b761a78ea1a0dd6b02df7d25e93b496b6ff (diff) | |
download | chat-3f0325fd223dcb3a6eec92f772df1e7541ab0b2b.tar.gz chat-3f0325fd223dcb3a6eec92f772df1e7541ab0b2b.tar.bz2 chat-3f0325fd223dcb3a6eec92f772df1e7541ab0b2b.zip |
Fix parsing attachment field links into markdown (#2958) (#2959)
Field contents are stored in 'value' not 'text'.
Diffstat (limited to 'api')
-rw-r--r-- | api/post.go | 8 |
1 files changed, 4 insertions, 4 deletions
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 } } |