Auto line break when inserting custom macro

I am using atlassian merging , and I need a way to change the size, family, and color of the text using a custom 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 select this macro "Stylish" as such:

enter image description here

However, merging automatically adds a new tag

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

The brown fox jumped over the cow.

And I wanted to set the background color of the word fox to red and its highlight color to yellow. If I apply this macro to this word, I get something like this:

enter image description here

Thus, it automatically places a new line in the word to which the macro is assigned. I want it to contain the whole sentence and apply formatting to one word. Even if I select inline in the options, it still puts it on a new line.

The result is as follows:

enter image description here

Here is the screen shot in edit mode:

enter image description here

I chose it inline and published the page, but the result shows the brown on one line of fox on another line and finally jumped over the cow on another line. Atlassian Confluence 5.4.4 This macro should work as a <span> tag so that the element does not appear as a block style element.

+6
source share
1 answer

There is no good way to do this. There you can track the JIRA version: CONF-15860 .

0
source

Source: https://habr.com/ru/post/969602/


All Articles