Merge pull request #1058 from olivergondza/breakable-regex

[FIXED JENKINS-20928] l:breakable mishandles HTML metacharacters
This commit is contained in:
Oliver Gondža committed 2013-12-12 07:49:16 -08:00
commit ca139a7c9f
2 files changed
+22 -5

No files matched your search

+2 -2
View File
@@ -1826,8 +1826,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>")
;
}