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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

How do you wrap a code snippet in a code block macro?

Every time I add a code snippet into a code block macro, the code snippet remains in a single line without wrapping itself into multiple lines, unless I manually break the code snippet and bring the command into multiple, separate lines.

Is there a setting or property within the code block macro that I can set to wrap itself?

1 answer

There is actually a suggestion open for this with Atlassian (CONFSERVER-31476)

There is currently a workaround which is to add the following CSS to the global stylesheet (see the bug for more details)

.codeContent .syntaxhighlighter table td.code .container .line {
    white-space: normal!important;
}

I've tested it in the latest version of Confluence and you can add this to the Space CSS (Space Tools > Look and Feel > Stylesheet). This might be better approach as it will only apply for the given space. Remember, though, this will apply the style to all pages in the space with that macro, not just one.

I hope this helps!

Worked like a charm.

Thank you so much.

I tried on my own and the code still looks non-wrapped:

Code is inside the code block:

code-1.pngconde2.pngWhat am I missing?

Hi,

 

I would point out that cloud users have no option to modify the global stylesheet to add this workaround. Unless someone has an idea how to implement this?

is there a different app or plugin that would help us to achieve the code wrapping?

 

thx.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

82 views 0 3
Read article

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