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

User macros with unprocessed body lose html tags in round trip

XMLWordPrintable

      If a user macro with an "unprocessed macro body" has a body that contains html, then the html will be rendered in wysiwyg editing and lost when converted back to wiki markup. It should not be lost.

      Suppose you have a User macro with the following fields:

      Macro name: b
      Macro has a body: "Use unprocessed macro body"
      Output: Macro generates HTML markup
      Template: <b>$body</b>

      It's something of a bad idea, because it shouldn't really use an unprocessed body, it should use a wiki macro body, but it is possible, and it will work to make whatever is put inside it as bold. If somebody uses this macro as follows:

      {b}<i>text</i>{b}
      

      The macro will work when using wikimarkup, rendering text in bold and italics. When using the rich text editor, the italics will be included in the body and text will render in italics. (They probably should be escaped). When the conversion back to wiki markup happens, an assumption is made that the user macro has an unrendered body and so all html is stripped from it.

      The problem seems to be that com.atlassian.renderer.wysiwyg.WysiwygMacroHelper#renderMacroWithoutRenderableBody (in 2.10) doesn't escape html in the body.

              don.willis@atlassian.com Don Willis
              don.willis@atlassian.com Don Willis
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: