mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 11:06:25 +00:00
Merge pull request #1058 from olivergondza/breakable-regex
[FIXED JENKINS-20928] l:breakable mishandles HTML metacharacters
This commit is contained in:
commit
ca139a7c9f
2 files changed
+22
-5
No files matched your search
@@ -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>")
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user