summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorKoosha KM <koosha.khajeh@gmail.com>2014-08-28 19:17:54 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-08-28 19:17:54 +0200
commitec5caa57cc14a328b8b994d49cb8def8eb95aea7 (patch)
tree08eec320a2361b41fcd400259770d6357a913e15 /Bugzilla/Template.pm
parent82346032ecfef148e78a8d19e17c5ed41ed41d10 (diff)
downloadbugzilla-ec5caa57cc14a328b8b994d49cb8def8eb95aea7.tar.gz
bugzilla-ec5caa57cc14a328b8b994d49cb8def8eb95aea7.tar.xz
Bug 330707: Add optional support for MarkDown
r=dkl,a=sgreen
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 7e3527857..78a3e4120 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -807,6 +807,23 @@ sub create {
1
],
+ markdown => [ sub {
+ my ($context, $bug, $comment, $user) = @_;
+ return sub {
+ my $text = shift;
+ return unless $text;
+
+ if ((ref($comment) eq 'HASH' && $comment->{is_markdown})
+ || (ref($comment) eq 'Bugzilla::Comment' && $comment->is_markdown))
+ {
+ return Bugzilla->markdown->markdown($text);
+ }
+ return quoteUrls($text, $bug, $comment, $user);
+ };
+ },
+ 1
+ ],
+
bug_link => [ sub {
my ($context, $bug, $options) = @_;
return sub {