]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1428270 - Unwrappable content in summary can cause top buttons to bleed out of...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Tue, 23 Jan 2018 16:22:40 +0000 (11:22 -0500)
committerDylan William Hardison <dylan@hardison.net>
Tue, 23 Jan 2018 16:22:40 +0000 (11:22 -0500)
Bugzilla/Template.pm
extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/list/table.html.tmpl

index f93b025bfee0c29753151468ff78d89dc1d3f80d..87496a89ecd8d502c7daf0c3efe3d3a2f3550301 100644 (file)
@@ -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 %
index 324b7863c4d29b82189e92609e132888a55402bf..02f18b7ad3432d72eccabbad091b96d0702ee5ce 100644 (file)
         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 %]
index 22e1ab05ae69afb1150c0f874021c11a918e7e0b..84a20b97eb249d57ce8603378013a484e95d35aa 100644 (file)
           (<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>
index b1ab82a41cd06f50ea8acd5ee7991ff3df400593..df2f6b349e9477141c651e04cb9a319af1cb548a 100644 (file)
                                         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 %]">