You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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?
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried on my own and the code still looks non-wrapped:
Code is inside the code block:
What am I missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here.
Although in the old confluence editor code snippets were wrapped by default. So frustrating if new releases set you back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See this - https://confluence.atlassian.com/doc/code-block-macro-139390.html and help us convince Atlassian guys to simply add a parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Atlassian,
To be able control whether to line-wrap or not, you can add to a parameter to the Code Block Macro, which already has lots of interesting parameters:
https://confluence.atlassian.com/doc/code-block-macro-139390.html
Please do this improvement in the macro.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.