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

How to prevent escaping of backslash when pasting markdown codeblock?

Adam Lewandowski January 18, 2023

Some time within the last month or so, Confluence's behavior when pasting in a markdown codeblock changed such that any backslash characters are being doubled up (each backslash in the source text results in two backslashes in the resulting codeblock on the page). 

We use the codeblock syntax to post command-lines, which is convenient for copy-paste using the 'copy' button. But the 'escaping'(?) of the backslashes negates this utility. As far as I can tell, there is no way to prevent this. No matter what I do, the backslashes are doubled up inside the code block.

 

For example, if I copy the literal text below on to my clipboard:

```
commandline with a \
``` 

Then paste it (as plain text) into the current Confluence editor, the resulting code block looks like this:
codeblock.png

Like I said, this only started happening recently. In the past this has pasted without issue. Is there any way to disable this behavior?

2 answers

1 vote
Mike Walter January 26, 2023

A bug ticket has been created. https://jira.atlassian.com/browse/CONFCLOUD-75244

0 votes
Connor
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.
January 24, 2023

Hi @Adam Lewandowski I tried every variation of your example I could think of and I wasn't able to get it to paste without the double backslash. The only way was to create the code snippet first and paste the command without the enclosing back ticks into it. Which obviously isn't ideal as it's more work than simply copy/pasting the markdown.

If this was working for you previously I suggest opening a support ticket with Atlassian. Maybe this is a new bug, or maybe they recently changed the behavior for some reason.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events