Single-spaced AND formattable lines in Confluence.

Rick Blum September 7, 2018

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, 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

1 answer

0 votes
Bill Bailey
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.
September 12, 2018

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.

Rick Blum September 12, 2018

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.

Bill Bailey
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.
September 12, 2018

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.

Rick Blum September 12, 2018

{Code Block} does not allow formatting.

Bill Bailey
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.
September 12, 2018

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events