]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 524891: Make leading whitespace not be trimmed from comments on display.
authormkanat%bugzilla.org <>
Sun, 1 Nov 2009 20:14:11 +0000 (20:14 +0000)
committermkanat%bugzilla.org <>
Sun, 1 Nov 2009 20:14:11 +0000 (20:14 +0000)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat

Bugzilla/Bug.pm
template/en/default/bug/format_comment.txt.tmpl
template/en/default/email/newchangedmail.txt.tmpl

index 19e93f42c85a0d4c7e2dcab634f496fda24280e2..8dfe9fbf8d7f56a3fc4d8bc9511e3565ac510ff9 100644 (file)
@@ -3095,6 +3095,7 @@ sub format_comment {
 
     $template->process("bug/format_comment.txt.tmpl", $vars, \$body)
         || ThrowTemplateError($template->error());
+    $body =~ s/^X//;
     return $body;
 }
 
index 87734a9ae037b488ba4e3268f3f8005ff92239bc..d53ec44c516c1fb31dfc079e337c061e7ded1c8d 100644 (file)
   # Contributor(s): Marc Schumann <wurblzap@gmail.com>
   #%]
 
+[%# NOTE: Everywhere you use this template, you must call 
+  # "FILTER remove('^X')" on the result. This is unfortunately the only way
+  # to preserve leading whitespace in comments.
+  #%]
+
 [%# INTERFACE:
   #   comment: A hash containing comment information.
   #              count:           The comment number (on the bug it belongs to)
@@ -34,7 +39,7 @@
 [% PROCESS 'global/field-descs.none.tmpl' %]
 
 [%- IF comment.type == constants.CMT_DUPE_OF -%]
-[% comment.body %]
+X[% comment.body %]
 
 *** This [% terms.bug %] has been marked as a duplicate of [% terms.bug %] [%+ comment.extra_data %] ***
 [% ELSIF comment.type == constants.CMT_HAS_DUPE %]
@@ -42,7 +47,7 @@
 [% ELSIF comment.type == constants.CMT_POPULAR_VOTES %]
 *** This [% terms.bug %] has been confirmed by popular vote. ***
 [% ELSIF comment.type == constants.CMT_MOVED_TO %]
-[% comment.body %]
+X[% comment.body %]
 
 [%+ terms.Bug %] moved to [% Param("move-to-url") %].
 If the move succeeded, [% comment.extra_data %] will receive a mail containing
@@ -51,5 +56,5 @@ If all went well, please mark this [% terms.bug %]
 [%+ get_status('VERIFIED') %], and paste in a link to the new [% terms.bug %].
 Otherwise, reopen this [% terms.bug %].
 [%- ELSE -%]
-[%- comment.body %]
+X[%- comment.body %]
 [% END %]
index ab614c1da20cd555ae5d8d1aaf2665867f3d6e23..9b1443bc2fbb89e760e4cc075b5ad622551731ac 100644 (file)
@@ -50,7 +50,7 @@ X-Bugzilla-Changed-Fields: [% changedfields %]
 [%- IF comment.count %]
 --- Comment #[% comment.count %] from [% comment.author.identity %] [%+ comment.time FILTER time %] ---
 [% END %]
-[%+ PROCESS bug/format_comment.txt.tmpl comment = comment %]
+[%+ FILTER remove('^X') %][% PROCESS bug/format_comment.txt.tmpl %][% END %]
 [% END %]
 
 -- [%# Protect the trailing space of the signature marker %]