Forums

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

Code Block Macro: Line Break

Ralf Fehling
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.
April 14, 2025

Hi,

I have currently added the following code as custom HTML to force a line break.

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

There has been an update to the code block macro: https://confluence.atlassian.com/doc/code-block-macro-139390.html

I would like to have “Turn on wrap” activated when loading the page.

Can a CSS specialist help me customize the custom HTML?

Best Regrads
Ralf

1 answer

0 votes
Shawn Doyle - ReleaseTEAM
Community Champion
April 15, 2025

Hi @Ralf Fehling 

 

I haven't tested this, but have you tried 

word-wrap: break-word;
Ralf Fehling
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.
April 15, 2025

Hello Shawn Doyle,
thanks for the feedback.

The structure has changed. It is no longer displayed in a table.

I have tried the following code today. Unfortunately, it does not activate the desired behavior.

code[class*="language-"] {
white-space: pre-wrap !important;
word-break: break-word !important;
}

This data is used when the function is deactivated.

style Attribut {
white-space: pre;
}

And this data when the function is activated.

style Attribut {
white-space: pre-wrap;
word-break: break-word;
}

Best Regards
Ralf

Shawn Doyle - ReleaseTEAM
Community Champion
April 15, 2025

ah, I see what you mean, try changing the table and td reference to text. Again, not tested.

.codeContent .syntaxhighlighter .text .container .line {
white-space: normal!important;
}

Otherwise, open up the source for the page with the macro and see what section it is putting your codeblock into, then add that.

Ralf Fehling
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.
April 16, 2025

Thank you. For your information, the code does not work.

Here are two pictures to clarify the change.

Old

conf_8.5.png

New

conf_9.2.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.2.3
TAGS
AUG Leaders

Atlassian Community Events