Better fix for ISSUE#1031 (log messages not wrapping on changes pages). Multiple spaces are replaced with   (except for the last one) and single spaces are unchanged. This means significant whitespace is retained without prohibiting wrapping.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6008 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
dwdyer committed 2007-11-22 20:06:08 +00:00
1 parent 1de091b92a
commit 5bbf6acc58
1 file changed
+8
+8
View File
@@ -456,6 +456,14 @@ public class Util {
else
if(ch=='&')
buf.append("&");
else
if(ch==' ') {
// All spaces in a block of consecutive spaces are converted to
// non-breaking space ( ) except for the last one. This allows
// significant whitespace to be retained without prohibiting wrapping.
char nextCh = i+1 < text.length() ? text.charAt(i+1) : 0;
buf.append(nextCh==' ' ? "&nbsp;" : " ");
}
else
buf.append(ch);
}