Macro editors don't trim parameter value whitespace by default

The macro editor does not trim whitespace from parameter values by default.
I discovered that users can add a space at the end of a macro parameter value in the editor.

That space is persisted with the value:

<ac:parameter ac:name="foo">MyValue </ac:parameter>

This was the key to a difficult problem for me and one of my customers.

It seems like it might be a good change for Confluence macro editors to trim string values before saving them. The whitespace is invisible in the editor unless you notice the blinking cursor at the end of the value is spaced to the right by one space.

The space in the value is noticeable by looking at the Storage Format and, even then, it can be difficult to notice, given wrapping of text in whatever tool you are viewing it in. You have to be specifically looking for a space to notice it.

1 Like