Here are the steps to reproduce the issue:

      1. Enable all HTML module for the HTML plugin.
      2. Create a new page with the following code in the HTML macro:
        <html>
        <head>
        <style type="text/css">
        body {
        	background-color:yellow !important
        }
        </style>
        </head>
        <body>
        <p>css script</p>
        </body>
        <html>
        
      3. In the HTML macro preview, it shows up correctly:
      4. In the page preview, it fails to apply the background colour to the text:
      5. After saving the page, the background colour is not rendered at all.

        1. macro_preview.png
          macro_preview.png
          19 kB
        2. page_preview.png
          page_preview.png
          12 kB
        3. page_saved.png
          page_saved.png
          14 kB

            [CONFSERVER-34691] HTML macro failed to render the CSS setting correctly

            Chander Inguva added a comment - - edited

            i see the same issue on 5.9.2

            Chander Inguva added a comment - - edited i see the same issue on 5.9.2

            Hi shaffenden,

            I'm not very convinced about that, can you please explain the different view between the screenshot? How comes that the preview from the macro got a different view for the page preview?

            Also, the example from the w3 school explaining that how the style tag works : http://www.w3schools.com/tags/tag_style.asp, it used the style tag in the header and works.

            Many appreciated for your information.

            Yilin

            Yilin (Inactive) added a comment - Hi shaffenden , I'm not very convinced about that, can you please explain the different view between the screenshot? How comes that the preview from the macro got a different view for the page preview? Also, the example from the w3 school explaining that how the style tag works : http://www.w3schools.com/tags/tag_style.asp , it used the style tag in the header and works. Many appreciated for your information. Yilin

            Hi yilinmo

            Thanks for taking the time to raise this issue. The problem that you are seeing is caused by trying to nest two whole HTML documents together. The HTML and HEAD tags are being stripped out (probably by the browser) because the markup is invalid. You may find that moving the STYLE tag into the body of your macro will help resolve this issue.

            I'm going to close this issue as not a bug as I believe that the behaviour here is correct.

            Regards
            Steve Haffenden
            Confluence Bugmaster
            Atlassian

            Steve Haffenden (Inactive) added a comment - Hi yilinmo Thanks for taking the time to raise this issue. The problem that you are seeing is caused by trying to nest two whole HTML documents together. The HTML and HEAD tags are being stripped out (probably by the browser) because the markup is invalid. You may find that moving the STYLE tag into the body of your macro will help resolve this issue. I'm going to close this issue as not a bug as I believe that the behaviour here is correct. Regards Steve Haffenden Confluence Bugmaster Atlassian

              Unassigned Unassigned
              yilinmo Yilin (Inactive)
              Affected customers:
              3 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated: