Rich Text Editing destroys layout when using User Macros

XMLWordPrintable

      We have a user macro to e. g. change the background color and such things:

      span (with body):

      #set($wiki=$body)
      #set($type=$param0)
      #set($arg=$param1)
      ##

        1. The following currently does not work
          ##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 $type="$arg">${body}</span>##

      Using this macro in Wiki Markup:

      {span:style|background-color:red;}Hello{span}

      ,

      {span:style|background-color:red;}Hello{span}

      And then later be edited in RichText will result in:

      {span:style|background-color:red;}Hello{span}

      ,

      {span:style|background-color:red;}Hello{span}

      Which is obviously different from the expected result. There are other examples where Rich Text easily broke layout, so we currently decided to turn this feature off

              Assignee:
              Unassigned
              Reporter:
              Mark Michaelis
              Votes:
              14 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: