How do I get rid of the blank line at the beginning of the Table of Contents Zone macro?

Jared Brenner
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.
January 23, 2019

I've added a Table of Contents Zone macro and set the minimum heading level to 2, but a blank line still precedes the first Heading 2 entry.  I've reviewed other community discussions about this issue and most users had extra white space with Heading formatting - once they changed that to Paragraph the issue was resolved.

  • I've gone line by line in the editor and verified that there is no extra white space, and that all macros preceding the first Heading 2 entry are set to Paragraph.
  • I've checked the page source and verified that there are no extra <h2>...</h2> tags denoting anything else as Heading 2.
  • I've hit backspace after the Panel macro preceding the Table of Contents Zone macro (and every other line before the first Heading 2 entry) many times just to be sure there's no extra white space.  The cursor shows that line is formatted as Paragraph.

What else do you suggest I try to eliminate that blank line?  Here are screenshots of the published page and the editor:

Published page.PNGEditor with macros.PNG

8 answers

1 accepted

1 vote
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2019

Hello Jared and welcome to the Community!

Thank you for bringing this to our attention and posting the steps you used to recreate and cause the extra line break. I went through and was able to recreate the extra line break myself. This then leads me to the following article; Confluence Editor Automatically Adds Line Break Before or After a Macro. Within this article, there are a few workarounds for this issue:

Workaround

  • Install Confluence Source Editor plugin
  • Edit the source of the page using Confluence Source Editor plugin. Remove the unnecessary <div> tag from the content and save it. Now there shouldn't be any new line break added automatically every time you edit the page.

Another workaround, valid also in Cloud (above plugin is not available for Cloud instances), is to press SHIFT+ENTER instead of ENTER to go to a new line without adding a new paragraphs/div.

These workarounds should help to avoid the extra line return when creating content.

Regards,
Stephen Sifers

Jared Brenner
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.
January 29, 2019

I didn't have any extra <div> tags, but I did find the following in the source and deleting it solved my issue:

<p>
<br/>
</p>

 Thank you for the help!

Like # people like this
Rachel Wilson September 5, 2019

Good day,

I'm having the same issue when using Excerpt macro wrapped around a table and CANNOT install any plugins because I'm not an admin on our Confluence server.

When I use the Excerpt Include macro and found that there is an extra line break.

Looking at the source, I found that there is an extra br in the Excerpt in the main page that I CAN'T get rid of no matter what I try... -_-

Help... Please.

3 votes
Michael Scholze
Contributor
March 13, 2020

This is still a huge issue almost everywhere when trying to design clean content. The constant addition of white space really needs to go. The workaround with the Source editor does NOT work because there is always a new addition of newlines once the page is saved. 

This is particularly annoying when including pages somewhere else because the macro output almost guaranteed generates an extra whitespace newline.

1 vote
Harry Saddler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2020

I've deleted the first blank line hundreds of times (either by deleting, backspacing, or removing the p and br tags in source editor)… why does it keep appearing? It keeps inserting that line by itself.

Majken Longlade March 5, 2020

Same, I can't get rid of them and they're messing up the formatting of tables.

0 votes
Daniil Mitrofanov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 19, 2024

Issue is still there. There is no solution.

0 votes
VML Standard April 21, 2023

This is about incerting table of content in the beginning of the page in Confluence 7.13.7 or around that version, is it?

 

I have solved it by not having new line after the table of content.

Something like this:

<TOC>Blah  Blah..

 

Instead of

<TOC>

Blah Blah

 

I still think Atlassian should address this or mybe it has been addressed already in the newer versions

0 votes
Dominik Veliký
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 10, 2023

This one cannot be closed as the plugin is not supported anymore, but the issue is still present. Is there another workaround or better... Do you plan to fix it?

 

Thanks!

0 votes
Michael Scholze
Contributor
November 15, 2022

Hello everyone. Since we all know how Atlassian (not) handles their Confluence problems by now, I worked around this with some CSS fix. You test and can add this to your global Confluence Stylesheet. 

It's a messy fix that just hides the outcome, but at least you can design your pages more cleanly that way without the extra whitespace. Feel free to add other "first-child"  formattings as you need, but be aware that it may hide the first line of content in some scenarios, so the selector must be chosen very specific.

In "<yourConfluenceURL>/admin/viewstylesheet.action" add:

  1. /****************************************************/  
  2. /* Experimental Confluence Bullshit fixes */  
  3. /****************************************************/  
  4.   
  5. .panelContent br:first-child {  
  6.     display: none;  
  7. }  
  8.   
  9. p.content-wrapper br:first-child {  
  10.     display: none;  
  11. }  
  12.   
  13. .conf-macro.output-block [data-macro-name="include"] br:first-child {  
  14.     display: none;  
  15. }  
0 votes
Harry Saddler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 5, 2020

This is marked closed? The issue is still there. The 'edit the html' answer isn't an answer.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events