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

Adding line breaks between two macros in a Confluence page won't be properly rendered as new lines

    XMLWordPrintable

Details

    Description

      Issue Summary

      When a macro is inserted in a page, the Confluence editor adds the following HTML tag before the macro code:

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

      Pointing the editor cursor to the line with this code and adding line breaks will create new paragraphs with the same class tag.
      When the page is published, these paragraphs are not rendered as expected in page view mode, since they are not treated as new lines.

      Steps to Reproduce

      1. Install a vanilla instance of Confluence.
        • This was validated on Confluence 7.4.3 and 7.7.2.
        • The issue did not exist on Confluence 6.6.3 nor on 6.13.4.
        • The issue does not occur if Collaborative Editing is disabled on the affected versions.
      2. Create a new Space.
      3. Create a sample page.
      4. In the first line of the page add an Info Macro.
      5. Use the up arrow keyboard button to go the previous line and add another Info Macro.
      6. Use the down arrow keyboard button to go the next line, which will be between both macros.
      7. Use the return (enter) keyboard button to add new lines between the two macros.
      8. Publish the page.

      Expected Results

      When the page is displayed, the new lines created between the two Info Macros are properly rendered as blank space.

      Actual Results

      There's no new line between the two macros.
      If you check the storage format it will be as below:

      <p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="info" ac:schema-version="1" ac:macro-id="03a53bba-bd52-43fb-b8bb-ef7efd2e172d"><ac:rich-text-body>
      <p><br /></p></ac:rich-text-body></ac:structured-macro>
      <p class="auto-cursor-target"><br /></p>
      <p class="auto-cursor-target"><br /></p>
      <p class="auto-cursor-target"><br /></p>
      <p class="auto-cursor-target"><br /></p>
      <p class="auto-cursor-target"><br /></p>
      <p class="auto-cursor-target"><br /></p>
      <p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="info" ac:schema-version="1" ac:macro-id="01b6f70e-1335-4b03-9428-c6dd60592343"><ac:rich-text-body>
      <p><br /></p></ac:rich-text-body></ac:structured-macro>
      <p><br /></p>
      



      Workaround

      When editing the page, select all lines between the macros and use the CMD+0 (CTRL+0) keyboard shortcut to change them to the regular paragraph formatting.

      Attachments

        1. screenshot-1.png
          screenshot-1.png
          61 kB
        2. screenshot-2.png
          screenshot-2.png
          214 kB

        Activity

          People

            Unassigned Unassigned
            tmasutti Thiago Masutti
            Votes:
            9 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated: