How do I get rid of the blank line at the beginning of the Table of Contents Zone macro?
Asked by Jared Brenner:

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.PNG](/t5/image/serverpage/image-id/43424i7F79F1112C0C4356/image-size/large?v=v2&px=999 "Published page.PNG")![Editor with macros.PNG](/t5/image/serverpage/image-id/43425i04A819B3470E7CC2/image-size/large?v=v2&px=999 "Editor with macros.PNG")


Answers:
author: Stephen Sifers
body: 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](https://confluence.atlassian.com/confkb/confluence-editor-automatically-adds-line-break-before-or-after-a-macro-323387527.html). Within this article, there are a few workarounds for this issue:
> Workaround
>
> * Install [Confluence Source Editor plugin](https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.editor.confluence-source-editor?_ga=2.21067897.313522065.1548681568-1581346095.1546457917&_gac=1.204686884.1547069774.EAIaIQobChMIvfeYgNTh3wIVAoGzCh3KxAjrEAAYASAAEgLwmvD_BwE)
> * 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

comments: author: Jared Brenner
body: 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!


author: Rachel Wilson
body: 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.


author: Michael Scholze
body: 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.


author: Harry Saddler
body: 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.

comments: author: Majken Longlade
body: Same, I can't get rid of them and they're messing up the formatting of tables.


author: VML Standard
body: 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


author: Dominik Velik?
body: 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!


author: Michael Scholze
body: 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. }


author: Harry Saddler
body: This is marked closed? The issue is still there. The 'edit the html' answer isn't an answer.


Tags: atl-adm

confluence-server

server