Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,650
Community Members
 
Community Events
184
Community Groups

How do I escape a backslash "\"?

I've used the backslash to escape most other special characters.  However, when I tried to escape a backslash, the expected "\\" was converted to a newline.

3 answers

This is due to a mistake Atlassian made with the markup syntax early on, using the double backslash character sequence as a newline. I agree that it is frustrating, but Atlassian has repeatedly stated that they won't fix it because it would break backwards compatibility.

As described in JRASERVER-9528, a bug report on this subject, the official recommendation/workaround is to use the HTML character sequence for the backslash character:

\

You can paste this character in: 

It looks like the backslash (REVERSE SOLIDUS), but it is actually another character, called FULLWIDTH REVERSE SOLIDUS. 

There is also this one: ﹨(SMALL REVERSE SOLIDUS) and this one: ╲ (BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT).

They really make you jump through hoops to get something that looks like a backslash in the Jira comment.

You can also insert a zero-width space in between the backslash and the character that would make it act like an escape. Like this:

\​_ or \​*

0 votes
Italo Qualisoni [e-Core]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Dec 21, 2020

Hi @Aaron Grosky ,

 

As far that I know you don't need to escape backslash "\"; You can go ahead and just use the backslash character.

I've tested in a JIRA description and I had the following result:

using \ resulted in \

using \\ resulted in a newline as you mentioned.

If my answer don't answer your question, please share with us step-by-step with your issue.

@Italo Qualisoni [e-Core]  Maybe a misunderstand.

As the AG said,  the expected "\\" was converted to a newline.

 

I raised the similar jira questions earlier: https://community.atlassian.com/t5/Jira-questions/How-do-i-input-quot-0-quot-and-quot-0-quot-in-JIRA-comments/qaq-p/1562170, no response yet.

Italo Qualisoni [e-Core]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Dec 22, 2020 • edited

If you want to have \\ you should type \\\\

 

use \\\\  results in \\

@Italo Qualisoni _e-Core_

@Wu Chen did not misunderstand me.  I tried to highlight a backslash, e.g. "... use a \ to ...".  *\* becomes ** and *\\* becomes two stars separated by a newline.

For consistency, any special character following a backslash should have its meaning changed.   \\ should make the second \ a printable \.  \@ should not complain about the text which follow it (an unescaped @ is not a problem since it formats correctly).  \newline should be the way to force a newline (change the newline from white space to a required newline).

IMO, both \\ and \@ not escaping the second character are bugs and should be fixed.  If \\ is a documented way of forcing a newline, then fixing this may be difficult because of backward compatibility.

Italo Qualisoni [e-Core]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Dec 22, 2020

It's documented here that \\ produces a new line:

https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=breaks

Now it's clear that you want to produce \ (bold \ character) using wiki markup.

Using the new WYSIWYG editor I can make it work and see in issue history *\\* is used. But if I try to create an issue using *\\* in the description, the issue description stay empty.

issueview.png

This might be indeed a bug and I would recommend open an issue to Atlassian support in https://support.atlassian.com/

Actually, the Atlassian documentation conflicts.  In one section, the \\ is clearly documented as creating a line break.  However, in another section the \ is said to remove the special properties of the following character.

As to the WYSIWYG editor, this is the first I've heard of it.  That may be a new feature that is not yet available where I work.

Yep, expected \\ characters (0x5c, 0x5c in ASCII) always can not be showed in JIRA comments.

I'm not sure why this rule exists, remove this "\\ creates a line break" limit, in fact, at least it's not bad .

Suggest an answer

Log in or Sign up to answer