User Macro creates extra space

I've been running into an issue recently with a user macro that wraps text in <span> tags. The macro is inlined in a configuration line with no spaces (.ini file style, since it's basically a .ini file..) like this:

foo={macro}

However on the output I'm seeing an added space like this:

foo= bar

That extra space may break this file, does anyone know what's generating it and (more importantly) how to get rid of it?

3 answers

1 accepted

Would you happen to remember the bit of CSS that you used to do this?

Yea, this is what I used on the span tag: margin-left:-.2em;

I was having the same issue with a custom macro I built. It was adding an extra space before the text I was outputting to the page. I couldn't figure out why so I ended up fixing it with CSS and moving the text back one space to make up for the extra space it was adding

After talking with Brikit Theme Press about this issue it was discovered that due to extra white space between the header of the macro and the actual macro itself, that Confluence was injecting this extra space ahead of the macro output.

Formatting the macro to be one contiguous block of text resolved the issue.

Thanks Jeremiah, this worked great!

 

I turned all the blank lines to

##

to keep my pretty code formatting.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

380 views 21 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you