I'm creating a Slack integration with the Slack API. I followed the documentation but the markdown formatting doesn't work on my attachments...
Here is my response object:
{
response_type: "in_channel",
text: "List:",
attachments: [
{
text: "*pseudo*:\nbla bla bla",
mrkdwn: true
}
]
}
The "*" are displayed and not evaluated. Did I make a mistake?
Set the attribute mrkdwn_in
in attachments:
"attachments": [
{
"text": "*pseudo*:\nbla bla bla",
"mrkdwn_in": ["text"]
}
]
See https://api.slack.com/docs/formatting for more information.
Rep limit for commenting to an answer is stupid ... how are people supposed to get reputation if they cannot even interact with the forum. Also sorry for necroing the old post, but it's the closest one to my issue that I've found so far.
Anyways, the mrkdwn_in
property doesn't help much with the stars *
problem in the attachments.
"attachments": [
{
"fallback": "Required plain-text summary of the attachment.",
"color": "#000000",
"mrkdwn_in": ["fields", "text"],
"fields": [
{
"title": "XXXXXX",
"value": "*PVC* avg: xxs, max: xxxs, avg-diff: xx% \n*EPH* avg: xxs, max: xxxs, avg-diff: xx%",
"short": true
},
{
"title": "XXXXXX",
"value": "*PVC* avg: xxs, max: xxxs, avg-diff: xx% \n*EPH* avg: xxs, max: xxxs, avg-diff: xx%",
"short": true
}
]
},
.
.
.
After avg-diff:
I'm inserting a string " *↑* "
and concatenating it with the rest of the message.
For some reason the downwards arrow " _↓_ "
gets translated to HTML correctly. It's just the bold
that's broken.
As a result, the message still contains the *
around the ASCII arrow, but the rest of the text like *PVC*
gets translated into HTML correctly
Screenshot of the attachment from Slack
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With