Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Code snippet removes line breaks

Fredrik
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 25, 2025

When editing a code snippet in v2 editor, if I add or remove text at the end of a line in a code snippet, the line break is removed. This is quite annoying, any tips how to resolve this?

2 answers

0 votes
Jessica
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 25, 2025

Hi @Fredrik Tedgren 

Welcome to the Atlassian Community!

I have added a code snippet macro and a piece of a code in there, using the Javascript option as an example, but I couldn't replicate the line break being removed from there, regardless if I added or remove text, in any part of the code.

It is possible that I'm missing something though, in the steps to reproduce this possible bug.

Are you using a specific option? Are you trying to edit anywhere in the code or this is happening only at specific parts of the code inside this macro?

Feel free to share any screenshots, but remember to blur or cut parts that shouldn't be public.

In case it is not possible to share anything and we are still unable to replicate, we would like to check further on how exactly this is triggering on your page(s). 
If that is something you would like and check further on a support ticket, as we can request access to your site there, please ask one of your site-admins/org-admins to raise a support request on your behalf.

Regards,
Jessica

Fredrik
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 28, 2025

I would then guess that it's something Firefox-related, since all other browsers use Chromium today.

 

Example:

I start with a simple JSON object, like this

before.png

Then after adding a comma at the end of the line, I get this

after.png

Jessica
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2025

Hey @Fredrik Tedgren 

Apologies for the delay to get back to you.

Thank you for confirming how you were doing it with an example and for mentioning you were using Firefox.

Indeed this issue does not occur with Chrome, but we are able to replicate easily in Firefox and it seems to be affecting only this browser.

With that in mind, I created the following bug with for our development team awareness:

I understand this is not the ideal, as you may and other users might have a preference to user the Firefox browser, but at this time, we would suggest using Chrome for example, to edit the code snippet, as this is not happening there.

I hope this helps!
Jessica

0 votes
Kristian Walker _Adaptavist_
Community Champion
April 25, 2025

Hi Frederik,

This sounds like a bug itself as line breaks should be maintained when editing a code snippet, and I would advise raising a support request with Atlassian to highlight this issue.

I have clicked the Request assistance button on this post to notify Atlassian Support so that they can look at this question for you.

The only workaround I can suggest would be to copy the code snippet to a text editor or IDE such as VS Code, edit it, and then paste it back into the code snippet to keep the line breaks maintained until the issue is resolved.

Regards,

Kristian

Suggest an answer

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

Atlassian Community Events