-
Bug
-
Resolution: Fixed
-
Medium
-
1.4.3
-
None
Using the workaround proposed in CONF-3887 and CONF-2293 to render User-Macro-Body contents there is a problem. Rendering the body will always embed the content into a HTML-paragraph-element (<p>).
Example:
User Macro bgcolor:
-----------------------
#set($color=$param0)
#set($wiki=$body)
#set($globalHelper=$action.getGlobalHelper())
#if($content)
#set($renderer=$globalHelper.getWikiStyleRenderer())
#set($context=$content.toPageContext())
#set($xhtml=$renderer.convertWikiToXHtml($context, $wiki))
#else
#set($xhtml=$globalHelper.renderConfluenceMacro($wiki))
#end
<span style="background-color:${color};">${xhtml}</span>##
--------------------------
Will render the Wiki-content:
{bgcolor:red}Red{bgcolor},
{bgcolor:green}Green{bgcolor},
{bgcolor:blue}Blue{bgcolor}to:
<span style="background-color:red;"><p>Red</p></span>
<span style="background-color:green;"><p>Green</p></span>
<span style="background-color:blue;"><p>Blue</p></span>
instead of:
<span style="background-color:red;">Red</span>
<span style="background-color:green;">Green</span>
<span style="background-color:blue;">Blue</span>
If there is no way to just remove the content from beeing embedded into a paragraph-element (for compatibility reasons) there should be at least an additional method with an additional argument like "boolean inline".
- is duplicated by
-
CONFSERVER-5456 Allow user macros to be 'inline'
- Closed
- is related to
-
CONFSERVER-15333 User macros: Allow wiki markup generating user macros to be inline
- Closed
- relates to
-
CONFSERVER-10790 User macro output being wrapped inside a <p> paragraph
- Closed