Slack: Code block language syntax highlighting annotations shouldn't show up in the message

Created on 29 Mar 2018  路  8Comments  路  Source: integrations/slack

Currently, if you define a code block in markdown, eg;

```python
def some_function(x):
    return x+1
\```

The "python" will show up in the code block body in the slack message when instead we'd want to either ignore it or enable syntax highlighting.

Most helpful comment

Has this been fixed? I am still getting this.

All 8 comments

Thanks @iamthebot for reporting the issue. This is actually an issue in https://github.com/integrations/html-to-mrkdwn/issues/3. I'm going to close this since we're tracking it there.

Has this been fixed? I am still getting this.

Same for me, still getting the described behaviour even though the linked issue is closed already

August 2019 <--- me too.

It is not fixed. Weird how come Slack does not support it even if it is a legal markdown. Mattermost has been supporting it for last 2yrs.

Does anyone know the real follow up issue? I couldn't find an open one for it, just already closed ones :(

It is not fixed. Weird how come Slack does not support it even if it is a legal markdown. Mattermost has been supporting it for last 2yrs.

Syntax highlighting in code blocks isn't a standard Markdown feature, but GitHub Flavored Markdown, which adds this syntax. Mattermost uses GFM and Slack doesn't actually use Markdown.

For example, Markdown uses double underscore (__Bold__) and asterisk (**Bold**) for bold text, and single underscore (_Italic_) and asterisk (*Italic*) for italics. Slack however, uses single underscore for italics and single asterisk for bold.

So it's not even a subset of Markdown, but they lend _some_ of the syntax from it, like the code block syntax.

It would be nice if they supported this outside of code snippets, though.

Just to make sure, that we are all on the same page.

Slack Integration

When code is part of a comment or PR on GitHub and the content is posted via the GitHub Slack-Integration, code blocks should be identified without having the language in the code block.
See:
code-pasted-by-slack-integration

This has been fixed by @bkeepers in https://github.com/integrations/html-to-mrkdwn/issues/3.

Slack input markdown

Everything that is typed in by the user is nothing this integration can control. Since Slack does not support GFM, the only thing to do is contacting the Slack support and/or create a feature request for Slack.
Thanks @fnky, for your awesome explanation and summary 馃憤

Was this page helpful?
0 / 5 - 0 ratings