You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2005/04/06 11:11:22 UTC

svn commit: r160269 - lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl

Author: michi
Date: Wed Apr  6 02:11:21 2005
New Revision: 160269

URL: http://svn.apache.org/viewcvs?view=rev&rev=160269
Log:
thanks to Simon Litwan the title of an image is being transformed into well-formed XML if inserted through BXE

Modified:
    lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl

Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl?view=diff&r1=160268&r2=160269
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl Wed Apr  6 02:11:21 2005
@@ -53,6 +53,20 @@
                       var caption = document.forms["image"].caption.value;
                       var title = document.forms["image"].title.value;
                       <![CDATA[
+                      <!--change < and & to entities-->
+                      link = link.replace(/&amp;/g, "&");          
+                      link = link.replace(/&/g, "&amp;");
+                      link = link.replace(/&lt;/g, "<");          
+                      link = link.replace(/</g, "&lt;");                      
+                      caption = caption.replace(/&amp;/g, "&");          
+                      caption = caption.replace(/&/g, "&amp;");
+                      caption = caption.replace(/&lt;/g, "<");          
+                      caption = caption.replace(/</g, "&lt;");                       
+                      title = title.replace(/&amp;/g, "&");          
+                      title = title.replace(/&/g, "&amp;");
+                      title = title.replace(/&lt;/g, "<");          
+                      title = title.replace(/</g, "&lt;");                       
+                                                                                           
                       var content = '<object xmlns="'+window.opener.XHTMLNS+'" href="'+link+'" title="'+title+'" type="'+type+'" data="'+nodeid + src+'">'+caption+'</object>'; 
                       ]]>
                       window.opener.bxe_insertContent(content,window.opener.bxe_ContextNode); 
@@ -221,7 +235,7 @@
                                                 </td>
                                             </tr>
                                             <tr>
-                                                <td class="lenya-form-caption"> 
+                                                <td class="lenya-form-caption" style="vertical-align:top"> 
                                                     <i18n:text>Link</i18n:text>:</td>
                                                 <td colspan="4" 
                                                     class="lenya-form-caption"> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org