It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

code macro in confluence removes common whitespace prefix from all lines Edited

Doc for the code macro states:


You type the code block directly into the macro placeholder in the editor. Note that any white space contained in the placeholder is not manipulated in any way by the Code Block macro. This is to provide the writer with flexibility over code indentation.

But, if I paste several lines which all have a common tab prefix, while they're shown with the common prefix in the edit view, when viewing the page, the common whitespace prefix is removed, shifting the text to the left margin.

My use case is explaining parts of python code, so the whitespace is important.

I can use { pre } but that loses the other functionality and border of the code block.

Confluence 6.13.4



0 answers

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you