How to force unwrap Code Macro
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
These instructions on customizing Confluence are not officially supported, per the Atlassian Support Offerings. This has been tested in Confluence 4.3.3.
Purpose
If the text inserted into a Code Macro in Confluence is too long, Confluence will wrap it to a new line.
Solution
- Navigate to the Stylesheet screen in Confluence Admin (at Browse >> Confluence Admin >> Stylesheet)
Add the following CSS:
code { /* forces the text not to wrap */ white-space: nowrap !important; }
- Click Save
Navigate to the page containing the wrapped code block. It should now be unwrapped.