30-04-2021



Markdown is one of my favorite formatting languages. For the unfamiliar, Markdown basically lets you use text to specify how a document should be formatted. So instead of using your mouse to navigate your text editor, you can use text symbols to format your document.

Slack Format Markdown Example

The Slack post interface has a Markdown editor with a real-time conversion feature, that is, the formatting of the content is shown as you type. With the real-time editor, the Markdown formatting symbols are removed and the result is displayed immediately, example: test- test. 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.

Slack is one of my favorite collaboration tools, but it unfortunately does not support composing messages in Markdown. I've always wanted to be able to do this, so this weekend, I got around to writing a Pandoc plugin that converts Markdown to Slack formatting.

Tutorial

It’s available here on GitHub: omarish/pandoc-md-to-slack. Calling it a v1 would be a compliment, but it supports all the use cases I need. Feedback / forks are welcome.

How to Use It

Example

Slack Markdown Support

Result:

Slack messaging interface

It is fair to say that sending messages on Slack is the tool's most used feature.

Markdown support in the Slack messaging interface leaves a little to be desired, however some elements that make up the basic syntax are available to the user.

Markdown Link Format

The application has formatting options in the WYSIWYG style and this is the default form enabled for all users.

The program also has a real-time editor that hides the Markdown content formatting while you're typing the message.

In this case using the interface formatting controls is optional.

To disable the Slack real-time editor a.k.a the parser that hides the Markdown markup, activate the option: Preferences > Advanced > Format messages with markup.

See the image below:

From now on, all Markdown symbols will remain on the screen and the WYSIWYG buttons will also disappear.

Slack allows the user to have several workplaces open at the same time, if this is your case, you must activate the Markdown for each one of them.

Slack

You can visit Slack at https://slack.com/.

Slack Format Markdown

Slack Markdown Table

Slack Markdown support in the messaging interface

Table 1.1 shows the Markdown elements that are supported in the Slack message interface, and also provides useful information about some of these elements.

Markdown
ElementSupportInformation
TitlesNo
ParagraphsNo
Line breaksNoSlack does not support the Markdown syntax for breaking a line, but you can still press the Shift + Enter key combination to achieve the same result.
BoldNoTo bold text, use an asterisk around the text, example: *Lorem*. Note that, this is the standard Markdown syntax to italicize content.
ItalicPartialOnly the use of an underscore is supported, example: _Lorem_.
BlockquoteYes
Ordered listsYes
Unordered listsYes
CodePartialSlack's messaging interface does not support code blocks.
Horizontal linesNo
LinksNo
ImagesNoThe Slack message editor does not provide support for Markdown formatting images. But you can still drag and drop an image file directly into the interface.
TablesNo
Fenced code blocksYes
FootnotesNo
Title IdNo
Definition listsNo
StrikethroughPartialSurround content with just one tilde, example: ~Lorem~.
Task listsNo
Emoji (copy and paste)Yes
Emoji (access codes)Yes
Automatic URL LinkYes
Disable automatic link from URLYes
HTMLNo

It is worth noting that the information above refers to messages used in the Slack user interface, when we use Slack's API for messages we get greater support for Markdown additional elements, elements that are not compatible with the user interface .

In the Slack API documentation you can check more information about compatibility.

Slack post interface

The Slack post interface has a Markdown editor with a real-time conversion feature, that is, the formatting of the content is shown as you type.

With the real-time editor, the Markdown formatting symbols are removed and the result is displayed immediately, example: _test_ -->test.

To create a new post on Slack, click on the button with a paper clip icon and select the Post option on the Create New menu.

See the image below.

Slack Markdown support in the post interface

Table 1.2 shows the Markdown elements compatible with the Slack post interface.

Slack Message Formatting Markdown

ElementSupportInformation
TitlesPartialThe Slack post interface supports only one # and two ## level headings and only the use of pound sign is allowed.
ParagraphsYes
Line breaksNo
BoldNoIn the Slack post interface use only one asterisk * to bold the content, as it is, this is the standard Markdown formatting for italics. A little confusion, but that's okay.
ItalicPartialOnly the use of the underline is supported in Slack, example: _Lorem_.
BlockquoteYes
Ordered listsYes
Unordered listsYes
CodeYes
Horizontal linesNo
LinksNo
ImagesNo
TablesNo
Fenced code blocksYesIt is not possible to highlight the syntax of code block based on the programming language.
FootnotesNo
Title IdNo
Definition listsNo
StrikethroughPartialSurround the content you want to cross out with just one tilde, example: ~Lorem~.
Task listsNo
Emoji (copy and paste)Yes
Emoji (access codes)Yes
Automatic URL LinkYes
Disable automatic link from URLYes
HTMLNo

Slack Markdown Format Link

See also