summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorKohei Yoshino <kohei.yoshino@gmail.com>2018-01-23 17:22:40 +0100
committerDylan William Hardison <dylan@hardison.net>2018-01-23 17:22:40 +0100
commit6d835375c1ccb19efabb1768acfb0d361ef931b4 (patch)
tree447321488842032e5c1d930d40b896d2e476689f /Bugzilla/Template.pm
parent67f06149b92e4ff8a7cbc671f2a00c4c566efa04 (diff)
downloadbugzilla-6d835375c1ccb19efabb1768acfb0d361ef931b4.tar.gz
bugzilla-6d835375c1ccb19efabb1768acfb0d361ef931b4.tar.xz
Bug 1428270 - Unwrappable content in summary can cause top buttons to bleed out of main content box
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index f93b025bf..87496a89e 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -683,6 +683,18 @@ sub create {
return $var;
},
+ # Insert `<wbr>` HTML tags to camel and snake case words in the
+ # given string so a long bug summary, for example, will be wrapped
+ # in a preferred manner rather than overflowing or expanding the
+ # parent element. Examples:
+ # * `test<wbr>_switch<wbr>_window<wbr>_content<wbr>.py`
+ # * `Test<wbr>Switch<wbr>To<wbr>Window<wbr>Content`
+ wbr => sub {
+ my ($var) = @_;
+ $var =~ s/([a-z])([A-Z\._])/$1<wbr>$2/g;
+ return $var;
+ },
+
xml => \&Bugzilla::Util::xml_quote ,
# This filter is similar to url_quote but used a \ instead of a %