Forums

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

Preformatted text aligns right

Pat D'Ambrosio
Contributor
June 1, 2018

Preformatted text, i.e., text used for code snippets needs to be properly indented. Is the only way to do this to create the styles in CSS?

 

Thanks,

 

Pat

4 answers

0 votes
akshayhazari
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!
October 19, 2021

A simple hack to this is -> 

After Pasting the preformatted text, select an extra line along with it

then the indent option becomes available which can be used to indent the code along with the extra line. 

Later we can remove the extra line or update it as required.

0 votes
Danyal Iqbal
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.
June 1, 2018

Preformatted text needs to be pre-indented :)

Pat D'Ambrosio
Contributor
June 1, 2018

Apologies Danyal, but I am confused, by pre-indented to u mean copied in from another source? I am unable to indent my preformatted text within confluence. 

Danyal Iqbal
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.
June 1, 2018

No, i mean you need to indent each preformatted line.

You are looking for code or the noformat macro here.

For these macros : if the code you copy is indented, the pasted code is also indented. If the code you copy is not indented, the pasted code is not indented.

0 votes
Pat D'Ambrosio
Contributor
June 1, 2018

Is there a macro or Add-On or should we look at CSS?

Alana Fernando
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.
June 1, 2018

If you coping the code from somewhere ; you can set indent there and paste the code inside code blocks. (set indent in notepad) 

screenshot-confluence.millenniumit.com-2018.06.01-17-14-27.png

If not try something from marketplace market place

0 votes
Alana Fernando
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.
June 1, 2018

@Pat D'Ambrosio , If you are trying to indented text inside code blocks macro. this is not possible in default confluence. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events