summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Template.pm8
-rwxr-xr-xchecksetup.pl1
-rw-r--r--t/004template.t1
-rw-r--r--template/en/default/admin/flag-type/list.html.tmpl2
-rw-r--r--template/en/default/attachment/list.html.tmpl2
-rw-r--r--template/en/default/flag/list.html.tmpl6
6 files changed, 15 insertions, 5 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index cddd33ba4..cb034478d 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -249,6 +249,14 @@ sub create {
return $var;
},
+ # Prevents line break on hyphens and whitespaces.
+ no_break => sub {
+ my ($var) = @_;
+ $var =~ s/ /\ /g;
+ $var =~ s/-/\‑/g;
+ return $var;
+ },
+
xml => \&Bugzilla::Util::xml_quote ,
# This filter escapes characters in a variable or value string for
diff --git a/checksetup.pl b/checksetup.pl
index 9615beb73..a01d0962a 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -1249,6 +1249,7 @@ END
obsolete => sub { return $_; },
js => sub { return $_; },
html_linebreak => sub { return $_; },
+ no_break => sub { return $_; },
url_quote => sub { return $_; },
xml => sub { return $_; },
quoteUrls => sub { return $_; },
diff --git a/t/004template.t b/t/004template.t
index 86b505c28..f35b53425 100644
--- a/t/004template.t
+++ b/t/004template.t
@@ -93,6 +93,7 @@ foreach my $include_path (@include_paths) {
FILTERS =>
{
html_linebreak => sub { return $_; },
+ no_break => sub { return $_; } ,
js => sub { return $_ } ,
inactive => [ sub { return sub { return $_; } }, 1] ,
closed => [ sub { return sub { return $_; } }, 1] ,
diff --git a/template/en/default/admin/flag-type/list.html.tmpl b/template/en/default/admin/flag-type/list.html.tmpl
index 44cbf36c2..9638df891 100644
--- a/template/en/default/admin/flag-type/list.html.tmpl
+++ b/template/en/default/admin/flag-type/list.html.tmpl
@@ -93,7 +93,7 @@
[% FOREACH type = types %]
<tr class="[% IF type.is_active %]active[% ELSE %]inactive[% END %]">
- <td><a href="editflagtypes.cgi?action=edit&amp;id=[% type.id %]">[% type.name FILTER html %]</a></td>
+ <td><a href="editflagtypes.cgi?action=edit&amp;id=[% type.id %]">[% type.name FILTER html FILTER no_break %]</a></td>
<td>[% type.description FILTER html %]</td>
<td>
<a href="editflagtypes.cgi?action=copy&amp;id=[% type.id %]">Copy</a>
diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl
index d5741d6a2..41115ab9c 100644
--- a/template/en/default/attachment/list.html.tmpl
+++ b/template/en/default/attachment/list.html.tmpl
@@ -59,7 +59,7 @@
[% IF flag.setter %]
[% flag.setter.nick FILTER html %]:
[% END %]
- [%+ flag.type.name FILTER html %][% flag.status %]
+ [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %]
[%+ IF flag.status == "?" && flag.requestee %]
([% flag.requestee.nick FILTER html %])
[% END %]<br>
diff --git a/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl
index 08f8c5547..f660b15ca 100644
--- a/template/en/default/flag/list.html.tmpl
+++ b/template/en/default/flag/list.html.tmpl
@@ -98,7 +98,7 @@
[% flag.setter.nick FILTER html %]:
</td>
<td>
- [% type.name FILTER html %]
+ [% type.name FILTER html FILTER no_break %]
</td>
<td>
<select id="flag-[% flag.id %]" name="flag-[% flag.id %]"
@@ -137,7 +137,7 @@
[% IF (!type.flags || type.flags.size == 0) && type.is_active %]
<tr>
<td>&nbsp;</td>
- <td>[% type.name FILTER html %]</td>
+ <td>[% type.name FILTER html FILTER no_break %]</td>
<td>
<select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]"
onchange="toggleRequesteeField(this);">
@@ -172,7 +172,7 @@
[% separator_displayed = 1 %]
[% END %]
<tr>
- <td colspan="2">addl. [% type.name FILTER html %]</td>
+ <td colspan="2">addl. [% type.name FILTER html FILTER no_break %]</td>
<td>
<select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]"
onchange="toggleRequesteeField(this);">