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

Expand macro within a Panel macro adds a line break

XMLWordPrintable

      Issue Summary

      Adding an 'Expand' macro within a 'Panel' macro adds a line break, which enlarges the Panel body when viewed in view mode.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Add Panel Macro on a Page.
      2. Add expand macro within the Panel macro.
      3. Publish/Update the page.

      Expected Results

      The Panel macro body should be normal without any line breaks or white spaces (as shown in the attached image_1).

      This is working as expected in Confluence v7.19.x. 

      Actual Results

      The body of the Panel macro contains line breaks or white spaces (as shown in the attached image_2), which detracts from its overall aesthetic appeal.

      Observation

      When tested in Confluence v7.19.x, class "auto-cursor-target" is added by default, which prevents a line break within the panel macro.

      <ac:structured-macro ac:macro-id="4ff5b5b1-4729-47f6-a3b3-f3c5ac85bca7" ac:name="panel" ac:schema-version="1">
        <ac:rich-text-body>
          <p class="auto-cursor-target">
            <br/>
          </p>
          <ac:structured-macro ac:macro-id="ed85bdff-1693-4804-b892-fcedb79e3f4e" ac:name="expand" ac:schema-version="1">
            <ac:rich-text-body>
              <p>
                <br/>
              </p>
            </ac:rich-text-body>
          </ac:structured-macro>
          <p class="auto-cursor-target">
            <br/>
          </p>
        </ac:rich-text-body>
      </ac:structured-macro>
      
      

      However in Confluence 8.5.x version, we see a line break in the Panel macro instead of class "auto-cursor-target"

      <ac:structured-macro ac:macro-id="2f892009-4934-451a-a56b-1c367644f886" ac:name="panel" ac:schema-version="1">
        <ac:rich-text-body>
          <ac:structured-macro ac:macro-id="1864580b-72b2-4d72-85fc-b55b222e8991" ac:name="expand" ac:schema-version="1">
            <ac:rich-text-body>
              <p>
                <br/>
              </p>
            </ac:rich-text-body>
          </ac:structured-macro>
          <p>
            <br/>
          </p>
        </ac:rich-text-body>
      </ac:structured-macro>
      

      Workaround

      Two workarounds are possible at the moment.

      1. Remove line break in the Panel macro HTML code using the source editor

      Remove line break
              <p>
                <br/>
              </p>
      

      2. Add class 'auto-cursor-target' in the Panel macro code to remove the line break using the source editor.

      Add 'auto-cursor-target' class
       <p class="auto-cursor-target">
            <br/>
          </p>
      

        1. image_2.png
          23 kB
          Sanjeev Rawat
        2. image_1.png
          23 kB
          Sanjeev Rawat

              mleizerovich Maxim Leizerovich
              005406c23381 Sanjeev Rawat
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: