mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 15:45:52 +00:00
[FIXED JENKINS-17030] Enable word breaking for job names
This commit is contained in:
1 parent
d391bbee07
commit
2c240bdc87
10 files changed
+64
-8
No files matched your search
@@ -1716,4 +1716,20 @@ public class Functions {
|
||||
DecimalFormat format = new DecimalFormat("#0.00");
|
||||
return format.format(number) + " " + measure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string that can be safely broken to several lines when necessary.
|
||||
*
|
||||
* This implementation inserts <wbr> tags into string. It allows browsers
|
||||
* to wrap line before any sequence of punctuation characters or anywhere
|
||||
* in the middle of prolonged sequences of word characters.
|
||||
*
|
||||
* @since 1.516
|
||||
*/
|
||||
public static String breakableString(final String plain) {
|
||||
|
||||
return plain.replaceAll("(\\p{Punct}+\\w)", "<wbr>$1")
|
||||
.replaceAll("(\\w{10})(?=\\w{3})", "$1<wbr>")
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user