The fallback text of date localization won't parse special characters for formatting. So I suppose it can be applied to escape special characters.
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*bold* _italic_ ~strikethrough~ `code` ~_*`foobar`*_~"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<!date^12345678^{dummy}|*>bold<!date^12345678^{dummy}|*> <!date^12345678^{dummy}|_>italic<!date^12345678^{dummy}|_> <!date^12345678^{dummy}|~>strikethrough<!date^12345678^{dummy}|~> <!date^12345678^{dummy}|`>code<!date^12345678^{dummy}|`> <!date^12345678^{dummy}|~_*`>foobar<!date^12345678^{dummy}|`*_~>"
}
}
]
}
Some exceptions are the quote character and escaping the content within hyperlink. They have to apply the classic replacement with the other character.
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<https://example.com/|<!date^12345678^{dummy}|*>test<!date^12345678^{dummy}|*>>"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<!date^12345678^{dummy}|>>"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<!date^12345678^{dummy}|>>"
}
}
]
}
Compared to replacing with similar character, the rendered message have kept the original character (except the leading quote and characters in hyperlink). Slack user can copy the message almost exactly expected by app.
Consume +21 characters per special character or its group to escape. Many fields have the limit of maximum characters so characters for the content would be less.