136

Slack uses various characters for its own markdown formatting.

How can I enter a message with those reserved characters escaped?

e.g. Is it possible to send a message exactly like this:

*I don't want this to be bold*

7
  • 40
    I wish I could downvote every answer here. Commented Aug 30, 2016 at 1:36
  • 1
    Can't you? @RichardSimões Commented Jan 30, 2017 at 10:17
  • 1
    Need more points! Commented Jan 30, 2017 at 17:55
  • 15
    This is why slack needs to get off their high-horse and use a proper markdown engine. Commented Aug 1, 2017 at 19:31
  • 1
    Don't worry guys it will be part of a big "Feature update" one day. Commented Jun 27, 2021 at 18:04

14 Answers 14

52

For the current WYSIWYG editor, hit Ctrl+Z immediately after conversion happened. For example:

abc *def* ghi

will result in

abc def ghi

On the other hand,

abc *def*<CTRL+Z> ghi

will result in

abc *def* ghi

This works for formatting only, not for Slack Emojis.

6
  • 5
    Well it took 4 years but we finally have an actual solution from Slack itself.
    – BadHorsie
    Commented Nov 21, 2019 at 13:59
  • 2
    Use ⌘Z on a Mac. Commented Nov 17, 2020 at 1:15
  • 4
    Note this only works when you have "Format messages with markup" switched OFF under preferences -> advanced (so you see a markup toolbar under the text input field). Otherwise, the formatting is only applied after you send the message, so you don't have the opportunity to undo it before sending.
    – rem
    Commented Apr 9, 2021 at 11:57
  • I know this answer is outdated, because these days people have phones. Commented Jun 27, 2021 at 18:01
  • This doesn't actually work for example if you want to say: Regarding your point #2 I have the following to say ... The #2 will turn into a channel link every time. If I type ^Z it simply disappears and I can't find any way to type it. I imagine copy/paste works, but that's a ridiculously horrible solution. Commented Feb 15, 2022 at 20:38
40

Solution

Copy and paste the text below and change the word in the asterisks for your own needs:

*bold*­

It will not be rendered as bold text when you post your Slack message. Note: There are hidden characters either side of the asterisks which will prevent Slack from formatting your word(s) between the asterisks.


Explanation

This is a variation of ShaneB's answer that seems to work better. Instead of adding (invisible) space to the asterisk's "attached" side:

There is *|no|* spoon            // '|' = vertical tab

consider removing space on the "detached" side by inserting (invisible) non-space:

There is |*no*| spoon            // '|' = e.g. soft hyphen (&shy;, U+00AD)

This "embeds" the asterisk and thus renders it inactive. Soft hyphen seems like a good character here.

7
  • 2
    Very good. I believe this to be the new best answer which gives the exact desired result. I have edited your post to provide a simple copy/paste solution for people who may not understand how to actually implement it.
    – BadHorsie
    Commented Jan 26, 2017 at 10:16
  • 1
    Apparently, you don't need the "shy" char on both sides, just one side is enough.
    – Kelvin
    Commented Nov 8, 2017 at 18:40
  • 1
    |*bold*| is all im getting Commented Dec 20, 2017 at 18:15
  • 4
    @AdrianBartholomew Instead of the pipe | you need to enter the unicode character (U+00AD). On Linux while holding down SHIFT+CTRL press u and then the keys ad. On Windows while holding down the ALT key type the keys 0173. More information on unicode input you can find at en.wikipedia.org/wiki/Unicode_input
    – SubOptimal
    Commented May 15, 2018 at 14:38
  • 1
    @BadHorsie Well, OK, but you need to understand that the idea of using this feature can't be to copy some text (meaning to always come back to your answer), remove some characters (hopefully not removing the only important one) and writing the actual message. The idea is to know how to write the important character. I don't know in what area or projects you work, but we don't work on same machines all the time (so forget about bookmarks) and sometimes work in a (ridiculously) restrictive network environment.
    – sjngm
    Commented May 11, 2019 at 16:21
20

I just tested and a single back-tick will escape upcoming formatting characters for the rest of the message.

`*I don't want this to be bold*`

That will be formatted as code

`*I don't want this to be bold*

That will be formatted normally but both asterisks will appear instead of making the text bold.

4
  • 4
    Interesting. I mean I guess this is something of a "hack" because you are simply making a broken code section, but also this leaves the undesired backtick.
    – BadHorsie
    Commented Jan 13, 2016 at 10:40
  • Yeah, it's not perfect and may be an unsupported hack.
    – pkoepke
    Commented Jan 14, 2016 at 11:55
  • 21
    but what about escaping backtick? Commented May 7, 2017 at 19:21
  • 1
    @GeorgeMauer It's backticks all the way down.
    – BadHorsie
    Commented Jun 9, 2022 at 19:45
15

UPDATE!: (2017-12-07)

It seems Google has updated the Chrome web browser controls (and possibly others) to show placeholders for many common ASCII control characters, INCLUDING the Vertical Tab character! This change has caused my original Solution below to break, now showing "unknown character" squares or in some cases whitespace breaks, where before it was non-breaking in most use cases (notably Slack!). Not to fear, there is a simple Fix!

FIX: Instead of using a Vertical Tab (hex character 0x0B), NOW use a Form Feed character (hex character 0x0C)!

Solution: Copy the below fixed text to Slack and Edit:

There is once again *no* spoon

Or use any hex to ascii converter (ie: ASCII to Hex) to convert this:

2a 0c 68 61 78 0c 2a

Personally I find it's always easiest and more compatible to use an ASCII range solution as opposed to tempting fate with a Unicode solution like in leclercdumombasin's answer. HOWEVER, as far as usability is concerned leclercdumombasin's answer is elegant in that you can simply copy and paste the soft-hyphen and tag any words you want to remain unformatted with only a single hidden character. The primary different between the two is my solution uses characters that will remain hidden if copy/pasted to a simple text-editor, whereas the soft-hyphen solution in my testing converts to a standard looking hyphen in common simple text-editors.

TL;DR: You now have TWO working solutions for the price of one!


ORIGINAL POST:

I had to agree with Richard Simões above, none of these answers actually provided a real solution. Though they're all correct in one sense, there is no intentionally built method to handle this use case, it would require a hack of some sort. ...And since none of the hacks provided so far are acceptable I grabbed a hotpocket and some Xena tapes and set out to prove my kung-fu was strong.

Result: My kung-fu was strong.

Solution: Use the Vertical Tab character.

As mentioned above you can use a space to sort of detach the asterisks from the word or phrase they're around, like so:

These * spaces * will keep it from becoming bold.

This in my opinion was the best answer given already, but it still adds the unsightly spaces. So instead if you were to use the Vertical Tab (VT) it would be enough to separate out the asterisk, without adding the additional space between the asterisks and the word(s) they surround.

Here is the character info, though I am unsure how StackExchange and/or your individual web browser will display this. If it automatically converts it to a space, or something similar refer below to an alternate method:

Vertical Tab (between quotes): ""
Decimal: 11
Hex: 0x0b

And in a sentence as you would use it on Slack, where I've tested it successfully, regardless of how it works here (just copy/paste into Slack):

There is *no* spoon.

The easiest way I've found to work with non-printable character hacks like this is to save the sequence in a text file as hex, then whenever I need to use them I can quickly open a new tab, google 'hex to ascii', then copy/paste via any converter. I also recommend using a text editor that has the option to show whitespace characters. Here is a string in hex to use, just convert to ascii and replace 'hax' with whatever you mean to type:

2a0b6861780b2a
4
  • 1
    My kind of guy. Good job. I mean, crazy, but cool solution. I left this question open for almost a year... this is the only real solution here.
    – BadHorsie
    Commented Oct 25, 2016 at 17:40
  • 1
    Interesting. This even works for backquotes - where spaces won't do at all. Commented Dec 19, 2016 at 8:34
  • On the latest Slack for Mac, the word didn't get bolded but the final result still has the unsightly spaces between the asterisks and the word they surround.
    – Kelvin
    Commented Nov 8, 2017 at 18:28
  • @Kelvin - Give it a shot using the newest edits I mentioned above, or try the soft-hyphen method mentioned in the other answer.
    – ShaneB
    Commented Dec 7, 2017 at 20:33
7

There is only one way to achieve what you want: Use a bot to create messages using the Slack API. Here's a page with an example showing how to do exactly what you want.


But if you, the human, are typing using the Slack client, as others have said, there's no way to produce a string of text surrounded by asterisks. If you don't want other kinds of formatting applied (like code), here are a few compromises that will get you close to what you want:

spaces (I find this more readable anyway)

* I don't want this to be bold *

leading backslash or underscore

\*I don't want this to be bold*

_*I don't want this to be bold*

4

There is a Unicode character, "Combining Grapheme Joiner" (͏Unicode: U+034F, UTF-8: CD 8F) that, if inserted just before one of the special characters in Slack, somehow nerfs Slack's detection of the special characters:

I don't want *this* to be bold
             ^- Insert it before this asterisk

This trick hack seems to escape the following character, allowing asterisks, tildes, underscores, and (for me most important of all) leading angle brackets to be typed without Slack using them as formatting codes.

I realize that this is a skanky hack: It's relatively easy on a Mac, but I can't speak for my Windows comrades whether this is easy to do or not.

PS: I tried several other Unicode characters, including backspace, thin space, hair space, zero-width space, and so forth, but Slack strips them, at least when they are the 1st character on a line (which makes typing something like > 9,000! as a comment impossible in Slack, because it becomes a blockquote).

1
  • 1
    This works. This can also be configured in apps like Keyboard Maestro or Typinator on macOS, or AutoHotKey on Windows, making it easy to insert the "Combining Grapheme Joiner" using a short keyboard macro or a hotkey.
    – Ville
    Commented Nov 14, 2018 at 18:56
2

Maybe use the Unicode U+066D (٭) character when you mean the * character?

The solution above in which the contributor recommends using the vertical tab character worked for me until I also included markup which used the .. syntax, at which point it did not.

2
  • Clean and simple solution.
    – BadHorsie
    Commented Jan 26, 2017 at 10:06
  • Also works for the other possible characters one might want to embed, for instance making a line start with >, use › instead. (U+203A)
    – Phil
    Commented Apr 23, 2017 at 22:10
2

To escape a special character, f.e. * or @, type the following characters right before the character that we want to escape:

Keep pressed:

<ctrl><shift>

Press and release, one after the other, the following characters:

u a d

Release:

<ctrl><shift>

For a moment, we will see, underlined: uAD which will soon become invisible.

Now you can type the special character.


This answer is given by @Suboptimal in a comment.

I tried to reply to him but the comments do not allow the needed formatting.

If he will post this answer, I will gladly upvote it and remove this one.

1
  • 1
    Ctrl+A now opens unreads so this doesn't work Commented Mar 16, 2021 at 21:32
1

Single back ticks will do it, triple back ticks will make it block text . . . but either will format it as code. As confirmed by this tweet by Slack.

`*I don't want this to be bold*`
3
  • 9
    I know single backticks format it as code, I am a developer and use them a lot but it's not what I want. It's not the same as escaping a character. I want the message unformatted; code style is formatted.
    – BadHorsie
    Commented Nov 11, 2015 at 17:37
  • 2
    Sorry it's not what you want. I failed with a variety of other options \,/<,<! etc. This tweet seems to indicate that it just doesn't exist. Commented Nov 11, 2015 at 23:20
  • Actually it's a matter of perspective whether code style is "formatted" and the default style is not. Both are formatted, just with different font families. "Default style" isn't necessarily "unformatted." The question is confusing at best, because the example on the final line shows the text in a monospace format with gray background, which is what Slack does when you use backticks.
    – LarsH
    Commented Jul 29, 2016 at 15:43
1

Another option is to double one of the asterisks.

*cough** and **cough* both work for me in my testing.

1

2021 and I still ended up in this thread, on my Windows PC the CTRL+Z worked, for my phone that didn't so I experimented a bit.

Simplest way I found that works for me on all platforms, add a space after the first asterisk, then after you type the word with the * after it delete the space

So type I do * not* want bold, then remove the space before "not" and it will keep the asterisk without making it bold: I do *not* want bold

0

You can enter a Hash with a space, then the text, then use backspace to connect the two.

I.e.

Start with......# SlackIsGreat

Then put the cursor at the 'S" and press backspace.

2
  • 2
    I don't think this is what the OP is after, honestly.
    – jonsca
    Commented Dec 26, 2016 at 2:41
  • I found this answer via a search for "slack escape character channel hash" and this is a good workaround for me. I realize it doesn't answer the question. Maybe it should be split out into its own question. Commented Dec 7, 2021 at 20:06
0

I’m adding this comment at this late date as this is the first hit from google for “escaping slack markup”, so hopefully my answer might help someone else save a bit of time. It’s also worth noting that I was looking for a solution that works through the Slack API, rather than the editor too.

Quite frankly, the whole Slack mark-up approach is a bit of a mess. Thankfully, the answer from leclercdumombasin put me on the right path to a general solution, so a huge thank-you to them!

For each of the characters Slack treats as a special mark-up token _*~ etc, if you wrap them in a pair of the soft-hyphen characters as described, then they can appear at the beginning, end, or middle of the text, and can be bracketed with whitespace or otherwise.

So for example to escape an _ within Unicode UTF-8 text the result would be \xc2\xad_\xc2\xad

0

I was unable to get any of the above solutions to work for me. We were sending a dash - character without any other text. It was being removed when sending the message to slack programatically. We found that if we send the dash in its unicode representation we found success "\u002D".

tl;dr Use Unicode Characters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.