User macro does not accept rich content
Asked by Rafael Castaneda:

Hi I have created a macro and is working almost fine I have configured bgcolor and TitleBGColor and other things I have moslty used the code on the manual example the probem is that when I add like Bold format is not showed in that way after I have saved the article, also returns are not considered.

this is the code I m using

## @paramTitle:title=Title\|type=string\|desc=Title  

\<ac:macro ac:name="panel"\>  
\<ac:parameter ac:name="titleBGColor"\>#c6ffc4\</ac:parameter\>  
\<ac:parameter ac:name="bgColor"\>#ffffff\</ac:parameter\>  
\<ac:parameter ac:name="borderStyle"\>solid\</ac:parameter\>  
\<ac:parameter ac:name="borderColor"\>\</ac:parameter\>  
\<ac:parameter ac:name="borderWidth"\>3\</ac:parameter\>  
\<ac:parameter ac:name="titleColor"\>#000000\</ac:parameter\>  
\<ac:parameter ac:name="title"\>$!paramTitle\</ac:parameter\>  
\<ac:rich-text-body\>$body\</ac:rich-text-body\>  
\</ac:macro\>

you can see my page here [](http://legajo-virtual.com:8090/pages/viewpage.action?pageId=557129)<http://legajo-virtual.com:8090/pages/viewpage.action?pageId=557129>


Answers:
author: David at David Simpson Apps
body: Your user macro is a wrapper for the **Panel macro** , so the best way to test correct behaviour would be to add a **Panel macro** to a page them go to **Tools \| View Storage Format** to get the resulting XML storage.

My first attempt with HTML nested in the body of a **Panel macro** gave:

```
&lt;ac:structured-macro ac:name="panel"&gt;	&lt;ac:parameter ac:name="bgColor"&gt;limegreen&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="title"&gt;dsafd&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="borderStyle"&gt;solid&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="borderColor"&gt;hotpink&lt;/ac:parameter&gt;	&lt;ac:rich-text-body&gt;o &lt;em&gt;what&lt;/em&gt; &lt;strong&gt;is&lt;/strong&gt; this?&lt;/ac:rich-text-body&gt;&lt;/ac:structured-macro&gt;
```

It looks like you need to swap out **ac:macro** with **ac:structured-macro** to produce:

```
&lt;ac:structured-macro ac:name="panel"&gt;	&lt;ac:parameter ac:name="titleBGColor"&gt;#c6ffc4&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="bgColor"&gt;#ffffff&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="borderStyle"&gt;solid&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="borderColor"&gt;&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="borderWidth"&gt;3&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="titleColor"&gt;#000000&lt;/ac:parameter&gt;	&lt;ac:parameter ac:name="title"&gt;$!paramTitle&lt;/ac:parameter&gt;	&lt;ac:rich-text-body&gt;$body&lt;/ac:rich-text-body&gt;&lt;/ac:structured-macro&gt;
```

comments: author: Rafael Castaneda
body: Thank you for your answer but I got the same results, reading a litte more I realized that when following the manual instructions for building a new user macro for a panel the manual say you should select "Escaped" mode. The solution was to select "Represented" on macro user definition, both of my code and yours work fine.


author: Rafael Castaneda
body: The solution: I realized that when following the manual instructions for building a new user macro for a panel the manual says you should select "Escaped" mode. The solution was to select "Represented" on macro user definition.


Tags: jira