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

Self closing HTML tags cause all data to be removed from macro parameters on page update

XMLWordPrintable

      Issue Summary

      This is reproducible on Data Center: (yes)

      If a macro parameter has HTML like <br/> or <hr/>, then the parameter is not saved in the Storage XML on page save. This happens with STATUS macro as well as user created macros.

      For this to work, the macro needs to have a String parameter

           <xhtml-macro name="ecohelp-macro" key="ecohelp-macro" class="com.atlassian.ecohelp.macro.EcohelpMacro" hasBody="true" bodyType="rendered" outputType="html">
              <parameters>
                  <parameter name="html" type="string" default="" description="HTML goes here" />
              </parameters>
          </xhtml-macro>

      When viewing the macro before the page update we see in the HTML <table/> that displays the grey macro box the attribute is

      data-macro-parameters="html=this will break<br/>" 

      When saving the storage format clearly has <ac:parameter ac:name="html"></ac:parameter> missing

      <ac:structured-macro ac:name="ecohelp-macro" ac:schema-version="1" ac:macro-id="53c87043-f519-40e8-85ba-c06b84f8ef50"><ac:rich-text-body>
      <p>Can I break this?</p></ac:rich-text-body></ac:structured-macro>
      

      And on second edit the display <table/> is also missing the data-macro-parameters.

      However, it works with

      <p>a paragraph</p>
      

      but anywhere in the HTML it has the <br/> or similar, it breaks.

      This is also an issue on site upgrades where macros in earlier versions of Confluence, on upgrade will have the parameters removed on page edit.

      Steps to Reproduce

      1. Create a status macro
      2. For the Title enter text<br/> and click INSERT
      3. Update the page

      Expected Results

      The macro displays as expected.

      Actual Results

      All data entered into the parameter fields is missing.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            bb797b5e39e7 Judy Lim
            jrichards@atlassian.com James Richards
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: