These strings are used to trigger special parsing of the text, like user mentions or advanced date formatting. We told you earlier about the need to escape certain strings in text objects. The list of emoji supported are taken from These will be converted into their colon-format equivalents. The compatible emoji formats are the Unicode Unified format (used by OSX 10.7 and iOS 6 ), the Softbank format (used by iOS 5) and the Google format (used by some Android devices). If you're retrieving messages, you'll receive the emojis in colon format, so you might want to convert them back to their unicode emoji form. If you're publishing text with emojis, you don't need to worry about converting them, just include them as-is. Will be converted into colon format: It's Friday :smile: For example, a message published like this: It's Friday ? Once published, Slack will then convert the emoji into their common 'colon' format. While this message: So does this one: Will be retrieved in this form: So does this one: Įmoji can be included in their full-color, fully-illustrated form directly in text. Will be represented in the API as: This message contains a URL When you use any of the messaging APIs to retrieve a message, you'll see that auto-transformed URLs are shown in the mrkdwn format. You can also use Block Kit buttons as links by using the url parameter in button elements. So does this one: You can also use mrkdwn to manually add links: This message contains a URL Īdjust the text that appears as the link from the URL to something else: To link to URLs casually in conversation, include the URL directly in mrkdwn text and it will be auto-transformed by the server into a link: This message contains a URL There's no specific list syntax in app-published text, but you can mimic list formatting with regular text and line breaks: - Detective Chimp\n- Bouncing Boy\n- Aqualad You can also highlight larger, multi-line code blocks by placing 3 back-ticks before and after the block: ```This is a code block\nAnd it's multi-line``` Text within inline code blocks will not use any other formatting, so it can be useful even if you're not displaying actual code. If you have text that you want to be highlighted like code ( like this), surround it with back-tick (`) characters: This is a sentence with some `inline *code*` in it. You can highlight some text as a block quote by using the > character at the beginning of one or more lines: This is unquoted text\n>This is quoted text\n>This is still quoted text\nThis is unquoted text again These styles help to organize or differentiate text for different purposes. Will produce the following formatting: This is a line of text. For example: This is a line of text.\nAnd this is another one. Insert a newline by including the string \n in your text. You can use multi-line text in app-generated text. ~strike~ will produce strikethrough text.These basic visual styles are very simple to use: This formatting is similar to Markdown markup, but with its own syntax, shown below. Mrkdwn is also the default formatting method for the top-level text field in a message object when using the Web API to publish a message.įinally, mrkdwn can be used within secondary message attachments by using the mrkdwn_in field as shown in the relevant reference guide. There are, however, a few Block Kit blocks and elements that only allow plain_text with no formatting - these are called out in the Block Kit reference guides. Use it in most Block Kit text objects by specifying a type of mrkdwn. Text objects contain a text field that can be formatted using a simple markup language called mrkdwn. You shouldn't HTML entity-encode the entire text, as only the specific characters shown above will be decoded for display in Slack. Slack uses
3 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |