summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Yoshino <kohei.yoshino@gmail.com>2018-02-28 16:29:43 +0100
committerDylan William Hardison <dylan@hardison.net>2018-02-28 16:29:43 +0100
commitc1b52f05823e69264df6c3c6f0c4cd10ba7cfb5a (patch)
treec95f9265277d2ef6fd7086b05581553d71918f91
parentbb164af697bd8e36a116e76c4a5f8dcfd1e79dd7 (diff)
downloadbugzilla-c1b52f05823e69264df6c3c6f0c4cd10ba7cfb5a.tar.gz
bugzilla-c1b52f05823e69264df6c3c6f0c4cd10ba7cfb5a.tar.xz
Bug 1433299 - Link in summary is broken
-rw-r--r--Bugzilla/Template.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 87496a89e..d27896532 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -683,15 +683,17 @@ 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:
+ # Insert `<wbr>` HTML tags to camel and snake case words as well as
+ # words containing dots 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. This conversion
+ # should exclude existing HTML tags such as links. Examples:
# * `test<wbr>_switch<wbr>_window<wbr>_content<wbr>.py`
# * `Test<wbr>Switch<wbr>To<wbr>Window<wbr>Content`
+ # * `<a href="https://www.mozilla.org/">mozilla<wbr>.org</a>`
wbr => sub {
my ($var) = @_;
- $var =~ s/([a-z])([A-Z\._])/$1<wbr>$2/g;
+ $var =~ s/([a-z])([A-Z\._])(?![^<]*>)/$1<wbr>$2/g;
return $var;
},