【问题标题】:Markdown not interpreted in Slack message block button confirm textMarkdown 未在 Slack 消息块按钮确认文本中解释
【发布时间】:2020-04-16 15:09:57
【问题描述】:

在 Slack 消息块中,添加按钮时,确认对话框文本应该支持 markdown。

https://api.slack.com/reference/block-kit/composition-objects#text

但它只显示纯文本:

{
    "blocks": [
        {
            "type": "section",
            "accessory": {
                "type": "button",
                "text": {
                    "type": "plain_text",
                    "text": "Validate"
                },
                "confirm":{
                    "title": {
                        "type": "plain_text",
                        "text": "Details"
                    },
                    "text": {
                        "type": "mrkdwn",
                        "text": "*bold* ?"
                    },
                    "confirm": {
                        "type": "plain_text",
                        "text": "Ok"
                    }
                }
            },
            "text": {
                "type": "mrkdwn",
                "text": "Hello World!"
            }
        }
    ]
}

【问题讨论】:

    标签: button markdown block message slack


    【解决方案1】:

    这似乎有效

    {
    "type": "modal",
    "title": {
        "type": "plain_text",
        "text": "My App",
        "emoji": true
    },
    "submit": {
        "type": "plain_text",
        "text": "Submit",
        "emoji": true
    },
    "close": {
        "type": "plain_text",
        "text": "Cancel",
        "emoji": true
    },
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "This is a mrkdwn section block :ghost: *this is bold*, and ~this is crossed out~, and <https://google.com|this is a link>"
            }
        }
    ]
    

    }

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题,因此我联系了 Slack 的支持人员,他们确认这是一个已知错误。他们还没有修复的预计到达时间。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-06-02
        • 2018-09-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多