Does Slack support Markdown tables?

后端 未结 2 1445
误落风尘
误落风尘 2021-02-12 12:22

I want to send a Markdown table to Slack with its postMessage API, but I got raw content in Slack instead of a rendered table. Does Slack support Markdown tables? I

2条回答
  •  甜味超标
    2021-02-12 12:37

    No, in fact, Slack doesn't support Markdown in messages¹ at all. It uses its own similar-at-a-glance format called mrkdwn which has some notable differences with Markdown:

    • In Markdown, both * and _ are used for emphasis
    • In Markdown, both ** and __ are used for bold
    • In mrkdwn * is used for bold and _ is used for emphasis
    • Markdown has no syntax for strikethrough (though some implementations have added it, e.g. in GFM which uses ~~) but mrkdwn uses ~ for strikethrough
    • Link syntax is very different
    • mrkdwn doesn't support headings
    • Probably more

    Don't expect arbitrary Markdown² to work in Slack messages.


    ¹Slack does support Markdown in posts which can be created using the files.upload API endpoint setting filetype to post.

    ²Note that tables aren't supported in regular Markdown either. Like strikethrough, some implementations have added these.

提交回复
热议问题