Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-4219

Can not render wiki content as inline text using user macros

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.3
    • 1.4.3
    • None

    Description

      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".

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              2f5ffb0094a7 Mark Michaelis
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: