summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Template.pm12
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl2
-rw-r--r--template/en/default/bug/edit.html.tmpl2
-rw-r--r--template/en/default/list/table.html.tmpl2
4 files changed, 15 insertions, 3 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 %
diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index 324b7863c..02f18b7ad 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -202,7 +202,7 @@
no_label = 1
hide_on_edit = 1
%]
- <h1 id="field-value-short_desc">[% bug.short_desc FILTER quoteUrls(bug) %]</h1>
+ <h1 id="field-value-short_desc">[% bug.short_desc FILTER quoteUrls(bug) FILTER wbr %]</h1>
[% END %]
[%# alias %]
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 22e1ab05a..84a20b97e 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -253,7 +253,7 @@
(<span id="alias_nonedit_display">[% bug.alias FILTER html %]</span>)
[% END %]
[% END %]
- <span role="heading" aria-level="1" id="short_desc_nonedit_display">[% bug.short_desc FILTER quoteUrls(bug) %]</span>
+ <span role="heading" aria-level="1" id="short_desc_nonedit_display">[% bug.short_desc FILTER quoteUrls(bug) FILTER wbr %]</span>
[% IF bug.check_can_change_field('short_desc', 0, 1) ||
bug.check_can_change_field('alias', 0, 1) %]
<small class="editme">(<a href="#" id="editme_action">edit</a>)</small>
diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl
index b1ab82a41..df2f6b349 100644
--- a/template/en/default/list/table.html.tmpl
+++ b/template/en/default/list/table.html.tmpl
@@ -230,7 +230,7 @@
col_abbrev.ellipsis) FILTER html %]
[% ELSIF column == 'short_desc' || column == "short_short_desc" %]
<a href="show_bug.cgi?id=[% bug.bug_id FILTER html %]">
- [%- bug.$column.truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html -%]
+ [%- bug.$column.truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html FILTER wbr -%]
</a>
[% ELSIF bug_fields.$column.type == constants.FIELD_TYPE_BUG_ID %]
<a href="show_bug.cgi?id=[% bug.$column FILTER html %]">