Single-spaced AND formattable lines in Confluence.
Asked by Rick Blum:

Hello,

I am trying to find a method to paste multi-line text content into a Confluence page such that the content remains formattable.

I have read this [similar answered post](https://community.atlassian.com/t5/Confluence-questions/single-space-vs-double-space-line-formatting/qaq-p/143962), which offers two approaches:

* *Using shift+enter to avoid double spaced lines when typing content*.
* *Using {no formatting} macro.*

The first allows formatting, but is not applicable to pasting content comprised of multiple lines. The second is good for pasting multi line, single spaced content, but allows no formatting

I have tried *shift+ctrl+v*, but it did not work.

Is there a technique to paste content into Confluence such that it is single spaced and can still be formatted?  

Thanks


Answers:
author: Bill Bailey
body: Not exactly sure what the problem is. You can paste text, tables and graphics into a Confluence page. Ctrl + V works every time. And it is formatable from there.

Now if you paste from an HTML source, you may paste in div and span tags which can cause some weird things. At that point, you can highlight that text and clear the formatting.

The other issue is that you can end up with each line being interpreted as a paragraph (wrapped in p tags). Just Ctrl +V paste, then go to the end of each line and hit delete to clear the return.

If this doesn't answer your question, then I need more info, like what do you mean by double spaced? I ask, because the line spacing is controlled via CSS, not on any keyboard command.

comments: author: Rick Blum
body: Thank you for your ideas Bill. Regarding your question: *Not exactly sure what the problem is.* Unfortunately I missed one important descriptive phrase in the first sentence of my post that may have been misleading: '*single-spaced'*. (although it is in the title, and in the last sentence). First, the mediums I am working with are text editors (mostly Sublime.) and terminal emulators (mostly Tera term.). Normally, ctrl-c and ctrl-v work fine to transfer content from either into the other, or another document, without any inserted line spacing, but my experience using ctrl-v in Confluence is that it results in inserting an extra line in single-spaced content that was copied using ctrl-c. For example:

***ctrl-c from Tera Term:***

cmd\> hw.test.hvddll -a  
\['Arm Command Received.'\]  
\['Command Completed Successfully.'\]  
mti\>

***ctrl-v into Confluence:***

cmd\> hw.test.hvddll -a

\['Arm Command Received.'\]

\['Command Completed Successfully.'\]

mti\>

Note that {No Format} macro works to maintain single-spacing, but of course does not allow formatting.

So, in summary, *I am trying to find a method to paste multi-line* \[single-spaced\] *text content into a Confluence page such that the content remains* \[single-spaced and\] *formattable*.


author: Bill Bailey
body: For this type of text (terminal output), I just insert it into a code macro (set to plain text), no title. Then you can easily delete any extra lines if they occur.


author: Rick Blum
body: {Code Block} does not allow formatting.


author: Bill Bailey
body: What formatting do you want to do?

Your only other easy solution is to delete the space between each line and then enter soft-returns (shift+Enter) - this inserts break tags (br).

What is happening is that when you paste, it is interpreting the returns at the end of each line as a new paragraph (wrapping each line in p tags). The default CSS shipped with Confluence adds space between p tags.

A more elegant solution is to create a user macro that wraps the content in a classed div tag. Then update the Confluence CSS to remove the p tag space for that CSS class. Then you can do what you want.