Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.8.1
-
None
-
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
- relates to
-
XWIKI-3472 HTML Macro breaks unprotected javascript
- Closed