Field contents are stored in 'value' not 'text'.
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
4b260b761a
Коммит
3f0325fd22
@@ -200,10 +200,10 @@ func CreateWebhookPost(c *Context, channelId, text, overrideUsername, overrideIc
|
|||||||
// parse attachment field links into Markdown format
|
// parse attachment field links into Markdown format
|
||||||
for j, fInt := range fields {
|
for j, fInt := range fields {
|
||||||
field := fInt.(map[string]interface{})
|
field := fInt.(map[string]interface{})
|
||||||
if _, ok := field["text"]; ok {
|
if _, ok := field["value"]; ok {
|
||||||
fText := field["text"].(string)
|
fValue := field["value"].(string)
|
||||||
fText = linkWithTextRegex.ReplaceAllString(fText, "[${2}](${1})")
|
fValue = linkWithTextRegex.ReplaceAllString(fValue, "[${2}](${1})")
|
||||||
field["text"] = fText
|
field["value"] = fValue
|
||||||
fields[j] = field
|
fields[j] = field
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,11 @@
|
|||||||
"short": true,
|
"short": true,
|
||||||
"title": "Short 2",
|
"title": "Short 2",
|
||||||
"value": "Another one"
|
"value": "Another one"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"short": true,
|
||||||
|
"title": "Field with link",
|
||||||
|
"value": "<http://example.com|Link>"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mrkdwn_in": [
|
"mrkdwn_in": [
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user