84

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*

migrated from superuser.com Nov 11 '15 at 14:39

This question came from our site for computer enthusiasts and power users.

  • 22
    I wish I could downvote every answer here. – Richard Simões Aug 30 '16 at 1:36
  • 1
    Can't you? @RichardSimões – technophyle Jan 30 '17 at 10:17
  • 1
    Need more points! – Richard Simões Jan 30 '17 at 17:55
  • 6
    This is why slack needs to get off their high-horse and use a proper markdown engine. – Qix Aug 1 '17 at 19:31
  • NOTE: the only working solution is the comment above my comment of leclercdumombasin's answer – sjngm May 10 at 8:14
33

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 (­, U+00AD)

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

  • 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 Jan 26 '17 at 10:16
  • 1
    Apparently, you don't need the "shy" char on both sides, just one side is enough. – Kelvin Nov 8 '17 at 18:40
  • 1
    |*bold*| is all im getting – Adrian Bartholomew Dec 20 '17 at 18:15
  • 3
    @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 May 15 '18 at 14:38
  • The comment above this one is the only working solution for technicians using Slack!!! – sjngm May 10 at 8:13
18

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.

  • 3
    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 Jan 13 '16 at 10:40
  • Yeah, it's not perfect and may be an unsupported hack. – pkoepke Jan 14 '16 at 11:55
  • 12
    but what about escaping backtick? – George Mauer May 7 '17 at 19:21
13

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
  • 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 Oct 25 '16 at 17:40
  • 1
    Interesting. This even works for backquotes - where spaces won't do at all. – Michał Politowski Dec 19 '16 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 Nov 8 '17 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 Dec 7 '17 at 20:33
5

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*

3

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
    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 Nov 14 '18 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.

  • Clean and simple solution. – BadHorsie Jan 26 '17 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 Apr 23 '17 at 22:10
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*`
  • 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 Nov 11 '15 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. – Tom Woodward Nov 11 '15 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 Jul 29 '16 at 15:43
1

Another option is to double one of the asterisks.

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

-1

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
    I don't think this is what the OP is after, honestly. – jonsca Dec 26 '16 at 2:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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