Stas
Stas

Reputation: 1725

How to escape "@" in markdown on bitbucket wiki

Anyone know how to escape the @ character in markdown on BitBucket wiki? In my case @ is immediately followed by the word which happened to be someone's user name, i.e. @blahblah. What I've tried so far:

\@  
'@  
&\#64;  

but none of those works. Shielding is just ignored, and when I'm using a character code, it just outputs it as is.

Upvotes: 19

Views: 8143

Answers (4)

Ryan
Ryan

Reputation: 24073

As @Mikalai mentioned here, you can put a "zero width space" character between the @ and the name. But I was having trouble following his instructions. It wasn't working for me.

This was easy:

  1. I clicked "Zero-Width Space (ZWSP) Character" at https://coolsymbol.com/, which copied that special character to my clipboard. (Thanks @harryngh)
  2. Then I pasted the character after the @ symbol while typing my Bitbucket comment. It worked!

Upvotes: 10

DaveC
DaveC

Reputation: 73

Our situation is related, a code snippet in Markdown with a JUnit test

```
@Test
public void testThis() throws Exception {
   //
}
```

It renders with the @Test annotation missing the @ but enclosed in a box.

----------------------------------------
Test 
public void testThis() throws Exception {
  //
}
----------------------------------------

I don't understand why inside a code block the @Test is still interpreted as a user reference. I got around it by putting a space between @ and the Test. It looks funny but gets the point across.

Upvotes: 3

jeffreydev
jeffreydev

Reputation: 1722

For those who didn't read the comment on the original question (like me initially):

"why would you need that outside a code block, which you can create with backticks like: `@foo`" - mb21

Upvotes: 3

Mikalai Daronin
Mikalai Daronin

Reputation: 8716

It sounds strange, but you can insert an invisible character between @ and text (e.g. zero width space).

MD code Result

Upvotes: 13

Related Questions