Author: keith
Date: Thu Feb 12 03:23:56 2009
New Revision: 30719
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=30719

Log:
fix for

uthor: jonathan
Date: Mon Sep  8 10:38:32 2008
New Revision: 21592
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=21592

Log:
MASHUP-1096: inserted non-visible (zero width) spaces after / and & to
allow long URLs to break more conveniently.  This solves the IE issue in a
limited way - long non-url strings won't break but this takes care of the
most common cases.


Modified:
   
branches/mashup/java/1.5/java/modules/core/src/org/wso2/mashup/webapp/utils/QueryParamUtils.java

Modified: 
branches/mashup/java/1.5/java/modules/core/src/org/wso2/mashup/webapp/utils/QueryParamUtils.java
URL: 
http://wso2.org/svn/browse/wso2/branches/mashup/java/1.5/java/modules/core/src/org/wso2/mashup/webapp/utils/QueryParamUtils.java?rev=30719&r1=30718&r2=30719&view=diff
==============================================================================
--- 
branches/mashup/java/1.5/java/modules/core/src/org/wso2/mashup/webapp/utils/QueryParamUtils.java
    (original)
+++ 
branches/mashup/java/1.5/java/modules/core/src/org/wso2/mashup/webapp/utils/QueryParamUtils.java
    Thu Feb 12 03:23:56 2009
@@ -147,13 +147,9 @@
             - truncating a list may result in an orphaned bullet
             - whitespace collapsing may affect <pre> tags
             - visible markup won't be trimmed (e.g. <hr>, <img>)
+            entities e.g. &lt; are counted as 4 charactets instead of one.
     */
     public static String trimVisibleChars(String markup, int length) {
-        // Optimization - if no trimming is necessary, return immediately.
-        if (markup.length() <= length) {
-            return markup;
-        }
-
         String trimmedMarkup = "";
         int charactersDisplayed = 0;
         boolean parsingTag = false;
@@ -197,6 +193,10 @@
                                 }
                             }
                         }
+                        // insert invisible breaking characters between url 
segments to allow IE to wrap urls
+                        if (c == '/' || (c == ';' && markup.charAt(i - 4) == 
'&' && markup.charAt(i - 3) == 'a' && markup.charAt(i - 2) == 'm' && 
markup.charAt(i - 1) == 'p')) {
+                            trimmedMarkup += "&#8203;"; // zero-width space
+                        }
                     }
                 }
             }

_______________________________________________
Mashup-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to