[FIXED JENKINS-20928] l:breakable mishandles HTML metacharacters

This commit is contained in:
Oliver Gondža committed 2013-12-12 15:16:13 +01:00
1 parent 23e9e7c0a6
commit 3f1f122ff4
2 files changed
+22 -5

No files matched your search

+2 -2
View File
@@ -1824,8 +1824,8 @@ public class Functions {
*/
public static String breakableString(final String plain) {
return plain.replaceAll("(\\p{Punct}+\\w)", "<wbr>$1")
.replaceAll("(\\w{10})(?=\\w{3})", "$1<wbr>")
return plain.replaceAll("([\\p{Punct}&&[^;]]+\\w)", "<wbr>$1")
.replaceAll("([^\\p{Punct}\\s-]{10})(?=[^\\p{Punct}\\s-]{3})", "$1<wbr>")
;
}