How do I control whitespace processing in confluence?
Asked by Brett Ryan:

With versions prior confluence 4.x whitespace was treated naturally allowing any excess whitespace to be ignored, now with 4.2.4 I'm going crazy as the macros keep putting extra whitespace after and before them, now making the documents look like they have whitespace holes in them. It looks pretty aweful.

I'd love to have the wiki editor back, but I know I can't get that, so is there a way to get whitespace to behave as it used to? i.e. if there is extra white-space, ignore it.

Following are examples of bad whitespace handling:

![](../../../upfiles/note-in-list-1.png)

![](../../../upfiles/note-in-list-2.png)

![](../../../upfiles/not-enough-space-1.png)

![](../../../upfiles/not-enough-space-2.png)

![](../../../upfiles/not-enough-space-3.png)

![](../../../upfiles/not-enough-space-4.png)


Answers:
author: Paul Curren
body: I think the best way to address your problems is to track each individual problem as a JIRA issue. However, I first need to make sure I understand each.

So starting with the screenshots.

**1) https://answers.atlassian.com/upfiles/note-in-list-1.png**

The image shows a blank line immediately after the 'note' macro.

You should be unable to remove this newline in the editor. These are 'cursor target paragraphs' that we insert in the editor to work around a limitation of the 'Rich Text Editing' components of most browsers. Basically, without them you would have nowhere to place the cursor if you wanted to add newlines before or after tables or macros.

Other instances you will see these 'target paragraphs' are tables or macros at the top or bottom of a page, or at the top and bottom of some other container (including within a list item).

These single 'target paragraphs' are removed for preview/rendering. They are simply an editor artifact.

However, if you as the author explicitly add further empty paragraphs then we assume this to mean you want the spacing retained and will not treat these as 'spacers'.

**2) https://answers.atlassian.com/upfiles/note-in-list-2.png**

This looks like a definite bug in some themes (some themes don't show the issue). I've raised <https://jira.atlassian.com/browse/CONF-25877>

**3) https://answers.atlassian.com/upfiles/not-enough-space-1.png and all the remaining excerpt related screenshots.**

Definitely a rendering bug with the excerpt macro. I've raised <https://jira.atlassian.com/browse/CONF-25878>

comments: author: Brett Ryan
body: Thanks Paul, your point (1) is fine, I was demonstrating that there is a space after in edit mode that disappears when saved which you pointed out as a bug in (2).

Following are some issues which aim to address some of the concerns.

* [CONF-25927](https://jira.atlassian.com/browse/CONF-25927) - [Excerpt macro removes white space between lines](https://jira.atlassian.com/browse/CONF-25927)
* [CONF-25926](https://jira.atlassian.com/browse/CONF-25926) - [Highlighting merged cells is buggy](https://jira.atlassian.com/browse/CONF-25926)
* [CONF-25925](https://jira.atlassian.com/browse/CONF-25925) - [Cursor jumps to the top of the editor window when aligning text in Safari](https://jira.atlassian.com/browse/CONF-25925)
* [CONF-25877](https://jira.atlassian.com/browse/CONF-25877) - [When panel macros such as tip, info, warning and note are used in a list there is insufficient spacing at the bottom of the macro](https://jira.atlassian.com/browse/CONF-25877)


author: Armon Tiongco
body: hey i would like to contribute to this. I've been getting a whitespace whenever I add a macro, and i can't seem to take out using backspace. that white space gets displayed once saved as well.


author: sdfewsdgwe
body: Spam, instabanned.


author: Paul Curren
body: I'm not sure what you are referring to? Do you mean that macros are rendering on a newline where they used to be inline?

Or are you talking about the newline around macro placeholders in the editor?

Or something else altogether? Some screenshots might help as well.

comments: author: Brett Ryan
body: If you take a look at our support ticket \[[CSP-83148](https://support.atlassian.com/browse/CSP-83148)\] you will see some examples, I'll try provide some here but need to take out sensitive information somehow.

One simple example is this. In the old wiki editor I could place new-lines around content to break it up, this would not be rendered and would be treated as a single new-line. I can no longer do this in v4. A a consequence in pages that were upgraded, they look fine, but clicking "Edit" reveals the whitespace is still there, so if I don't make ANY edits and just click save or preview the page fills with a heap of whitespace.

Another example is if I try to put a note in a list, the whitespace that's forced around macros now causes strange behavior, i.e. I used to be able to do the following:

```
* Item A* Item B\\{note}This is a note{note}* Item C
```

And it would render fine, however now the note looks too close to "Item C" when rendered.

Another example is with an excerpt, take the following example that used to work:

```
h2. Title{excerpt}This is an explanation{excerpt}
```

Now it renders with the excerpt being too close to the h2, however, if I add another h2 after the excerpt, it actually renders fine (as in the following).

```
h2. Title{excerpt}This is an explanation{excerpt}h2. Another Title
```

To be honest, this editor is driving us all insane, it looks good but usability is painful compared to the old wiki markup we used to use.


Tags: editor

whitespace