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

Using HTML tags inside the HTML macro breaks rendering on View and Edit screens

      Placing a full HTML page (including the doctype declaration, html and head tags) into an HTML macro breaks rendering on both the edit and view screens.

      Steps to Reproduce
      • Enable the HTML macro
      • Add an HTML macro to a page
      • Insert the following HTML:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Untitled Document</title>
      </head>
      <body>
         <h1>Hello world</h1>
         <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      </body>
      </html> 
      
      • Save the page

      Upon viewing the page, you'll see that the footer detaches from its position and ends up underneath the body content. See screenshot broken_rendering

      Upon editing the page, you'll see that the edit page is seemingly missing content. See screenshot broken_edit_1.

      The content has actually been pushed down the page, and rendered incorrectly. See screenshot broken_edit_2.

      Additionally, clicking the "Edit" and "Save" buttons do nothing.

      Reloading the edit screen shows the screen as expected.

      This behavior appeared regardless of which browser I used.

      Workaround

      Remove the doctype declaration and <html>, <head> (including anything within the <head>), and <body> tags. Include only the HTML of the actual element you want to use, such as a <form>.

        1. broken_edit_1.png
          broken_edit_1.png
          78 kB
        2. broken_edit_2.png
          broken_edit_2.png
          145 kB
        3. broken_rendering.png
          broken_rendering.png
          287 kB

            [CONFSERVER-35445] Using HTML tags inside the HTML macro breaks rendering on View and Edit screens

            Hi btom1

            Thanks for raising this issue. In this instance I'm going to close this issue out as won't fix. As you are aware the HTML macro allows the user to add arbitrary markup to the page, in order to resolve an issue like this we'd need to start parsing the information added to the macro to ensure that it was compatible with the page that it was being injected into. Given the infinite variation between what the user adds to the HTML macro and what may or may not be on the page it's better to make no assumptions around what is placed into the macro.

            Regards
            Steve Haffenden
            Confluence Bugmaster

            Steve Haffenden (Inactive) added a comment - Hi btom1 Thanks for raising this issue. In this instance I'm going to close this issue out as won't fix. As you are aware the HTML macro allows the user to add arbitrary markup to the page, in order to resolve an issue like this we'd need to start parsing the information added to the macro to ensure that it was compatible with the page that it was being injected into. Given the infinite variation between what the user adds to the HTML macro and what may or may not be on the page it's better to make no assumptions around what is placed into the macro. Regards Steve Haffenden Confluence Bugmaster

              shaffenden Steve Haffenden (Inactive)
              btom1 Brian
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: