Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-3567

HTML macro breaking on javascript

    XMLWordPrintable

Details

    • Unit

    Description

      I'm not sure if this is fixed by other bugs but I still have issues with js treatment of the html macro:

      The following JS does not go through. Currently it's impossible to work with js in 2.0 syntax pages

      {{html wiki="false"}}
      <script type="text/javascript">
      // <![CDATA[
       function escapeForXML(origtext) {
          return origtext.replace(/\&/g,'&'+'amp;').replace(/</g,'&'+'lt;')
              .replace(/>/g,'&'+'gt;').replace(/\'/g,'&'+'apos;').replace(/\"/g,'&'+'quot;');
       }
      // ]]>
      </script>
      {{/html}}
      
      {{html wiki="false"}}
      <script type="text/javascript">
      // <![CDATA[
      function addPage1(page, pageTitle) {
         alert(page);
         var el = $("pagepicker-1-items");
         el.innerHTML = el.innerHTML + "<li><span>XXX</span><img src='/xwiki/bin/view/clear.png'  style='vertical-align:middle;' /></li>";
      }
      // ]]>
      </script>
      {{/html}}
      
      {{html wiki="false"}}
      <script type="text/javascript">
      // <![CDATA[
      function addPage1(page, pageTitle) {
         alert(page);
         var el = $("pagepicker-1-items");
         el.innerHTML = el.innerHTML + "<li><span>XXX</span><img src='/xwiki/bin/view/clear.png'  style='vertical-align:middle;' onclick=\"removePage1('' + escapeForXML(page)                + "','" + escapeForXML(pageTitle) + "');\" /></li>";
      }
      // ]]>
      </script>
      {{/html}}
      

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              ludovic Ludovic Dubost
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: