I have a custom macro which renders the following markup into the page:

      #requireResource("custom.macro.suite:multimediaplayer-resources")
      #set ($baseUrl = $settingsManager.getGlobalSettings().getBaseUrl())
      #set ($playerUrl = $baseUrl+$webResourceManager.getStaticPluginResource("custom.macro.suite:multimediaplayer-resources","player.swf"))
      #set ($skinUrl = $baseUrl+$webResourceManager.getStaticPluginResource("custom.macro.suite:multimediaplayer-resources","blueratio.zip"))
      #set ($fileUrl = $baseUrl+$downloadPathWithoutVersion)
      #set ($rnd = "id_"+$hashCode)
      
      <div id="$rnd">$action.getText("custom.macro.suite.multimediaplayer.loading.msg")</div>
      <script type="text/javascript">
      /* <![CDATA[ */
          jwplayer("$rnd").setup({
              flashplayer: "$playerUrl",
              file: "$fileUrl",
      		height: $height,
      		width: $width,
      		skin: "$skinUrl",
      		autostart: "$autostart"
          });
      /* ]]> */
      </script>
      

      if I put the

      {toc}-macro in the same page it doesn't render but is displaying the following error:
      Error rendering macro 'toc' : [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxParsingException: String ']]>' not allowed in textual content, except as the end marker of CDATA section at [row,col {unknown-source}]: [171,5]
      


      As far as I know, the cdata-section in my markup is perfectly valid and shouldn't have any effect on the {toc}

      -macro.

            [CONFSERVER-25881] TOC Macro render error with cdata

            Hi TtheB

            Thanks for getting back in touch. Given that this is no longer an issue for you I am going to close this as "not a bug" If you have similar problems in the future then please raise another ticket.

            Regards

            Steve Haffenden (Inactive) added a comment - Hi TtheB Thanks for getting back in touch. Given that this is no longer an issue for you I am going to close this as "not a bug" If you have similar problems in the future then please raise another ticket. Regards

            Tim added a comment -

            Steve,

            we are still using Confluence 4 so I do not know if this issue is present in 5.1.3. However, since HTML5 this is not really an issue anymore.

            We used a XHTML 1.0 Strict DocType back then and without the CDATA Tag the page would not validate, because according to the DTD the default is PCDATA (Parsed Character Data) and you would have to escape tags like < > with

            &lt;

            and

            &gt;
            <script type="text/javascript">
                $("myText").setHTML("<p>Hi</p>");
            </script>
            

            for example would not validate, but by wrapping CDATA around it, it does.

            Tim added a comment - Steve, we are still using Confluence 4 so I do not know if this issue is present in 5.1.3. However, since HTML5 this is not really an issue anymore. We used a XHTML 1.0 Strict DocType back then and without the CDATA Tag the page would not validate, because according to the DTD the default is PCDATA (Parsed Character Data) and you would have to escape tags like < > with &lt; and &gt; <script type= "text/javascript" > $( "myText" ).setHTML( "<p>Hi</p>" ); </script> for example would not validate, but by wrapping CDATA around it, it does.

            Hi TtheB

            Thanks for raising this issue and apologies for the long delay in getting back to you. Is this still an issue for you? Are you able to reproduce this in the latest version of Confluence (5.1.3)? If it is, could you explain why you need to have a CDATA tag wrapping around your javascript?

            Regards

            Steve Haffenden (Inactive) added a comment - Hi TtheB Thanks for raising this issue and apologies for the long delay in getting back to you. Is this still an issue for you? Are you able to reproduce this in the latest version of Confluence (5.1.3)? If it is, could you explain why you need to have a CDATA tag wrapping around your javascript? Regards

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

                Created:
                Updated:
                Resolved: