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

Macro HTML bodies longer than 64k characters may exhibit split CDATA sections and/or corrupt JavaScript elements

XMLWordPrintable

      Issue Summary

      Macro HTML bodies longer than 64k characters may exhibit split CDATA sections and/or JavaScript elements.

      Steps to Reproduce

      1. Create a plugin
      2. Implement a macro which renders a Velocity file
      3. Embed one or more <script> elements in Velocity file
      4. Ensure evaluated HTML body is greater than 64k characters, and that roughly the 64kth character falls within a script element or CDATA section
      5. Install plugin
      6. Create a page and add the macro

      Expected Results

      Script executes in browser.

      Actual Results

      Browser throws syntax error as content is split into multiple CDATA sections surrounded by <![CDATA[ and ]]>.

      Workaround

      Add some dummy HTML around the 64kth character (i.e. right before the corrupted script element or CDATA section), such as:

      <span dummy="dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal dummyVal"></span>

            854eef6f5746 Kusal Kithul-Godage
            854eef6f5746 Kusal Kithul-Godage
            Votes:
            7 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: