]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1433299 - Link in summary is broken
authorKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 28 Feb 2018 15:29:43 +0000 (10:29 -0500)
committerDylan William Hardison <dylan@hardison.net>
Wed, 28 Feb 2018 15:29:43 +0000 (10:29 -0500)
Bugzilla/Template.pm

index 87496a89ecd8d502c7daf0c3efe3d3a2f3550301..d27896532d99073d5983e0425d8007b7a86e874c 100644 (file)
@@ -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;
             },