4

I'm experimenting with the Slack Block Kit, that supports markdown syntax. I'm trying to insert a numbered or bulleted list into the editor and can't seem to figure out how that works. Is there any way to achieve this?

Here is an example payload:

{
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "1  asjdfljasd 1 asdfkjasdf " <- should be a numbered list
            }
        },
    ]
Xen_mar
  • 8,330
  • 11
  • 51
  • 74

2 Answers2

2

The answer is that there isn't support for Markdown lists. Source:

There's no specific list syntax in app-published text, but you can mimic list formatting with regular text and line breaks

jellyberg
  • 168
  • 4
  • 14
Xen_mar
  • 8,330
  • 11
  • 51
  • 74
  • Specifically [here](https://api.slack.com/reference/surfaces/formatting#block-formatting): *"There's no specific list syntax in app-published text, but you can mimic list formatting with regular text and line breaks"* – jellyberg May 09 '23 at 16:20
1

Slack's templates for Block Kit had an unordered list. They used the unicode character • (hex 0x2022) instead of markdown. Markdown does not appear to work in blocks for lists.

"text": {
  "type": "mrkdwn",
  "text": "• Item 1\n• Item 2\n• Item 3"
}

Ordered lists would need you to type in the numbers unfortunately:

"text": {
  "type": "mrkdwn",
  "text": "1. Item 1\n2. Item 2\n3. Item 3"
}
Fammy
  • 513
  • 3
  • 14