6
votes

I'm using confluence from atlassian and I need a way to modify the text size, family, and color by using a user macro. I defined my macro as follows:

## @param 0:title=forecolor|type=string|desc=Text foreground color.  Enter colors such as: red / blue / green / etc.
## @param 1:title=backcolor|type=string|desc=Text background color.  Enter colors such as: red / blue / green / etc.
## @param 2:title=size|type=string|desc=Enter size in px, for example, 20px.
## @param 3:title=family|type=string|desc=Enter the font family (listing can be found here: http://www.w3.org/Style/Examples/007/fonts.en.html) (example: serif).
<span style="color: $param0; background-color: $param1; font-size: $param2; font-family: $param3;">$body</span>

Now the user can choose this macro 'Stylish' as such:

enter image description here

However confluence automatically adds a new line

tag with content I want to appear next to it. Assume I had the text:

The brown fox jumped over the cow.

And I wanted to set the background color of the word fox as red and its forecolor to yellow. If I apply this macro to that word I end up with something like this:

enter image description here

So it automatically puts a new line in on the word that has the macro assigned to it. I want to keep it inline the entire sentence and apply the formatting to a single word. Even If I select inline in the options it still puts it in a new line.

The result comes out to this:

enter image description here

Here is a screen shot in edit mode:

enter image description here

I have selected it inline, and published the page still the result shows the brown on one line fox on another line and finally jumped over the cow on yet another line. Atlassian Confluence 5.4.4 This macro should work like the <span> tag so that the item doesn't appear as a block style element.

1
I can't see your examples - MNRSullivan
Which radio button do you have selected for the macro body processing? - MNRSullivan
When I selected 'inline' in the options I managed to get it to work. I had to hit backspace with the cursor in front of the word after the macro though. Play around in the editor some more until it works, I can promise you it's possible. - MNRSullivan
This does not work, I have clicked inline and I have hit backspace in front of the word. - JonH
Well I tried to bounty this question but that too expired with no answers. I also had posted this on the atlassian q&a forum but got 0 hits. I went ahead and created a support ticket with atlassian and will provide any updates if they can resolve this. - JonH

1 Answers

0
votes

There is no good way of doing this. There's a JIRA issue you can track: CONF-15860.