From fd850e00db835d2b84c59014c3b1021fea2294fc Mon Sep 17 00:00:00 2001 From: Israel Madueme Date: Fri, 10 Aug 2018 08:57:01 -0400 Subject: Bug 1456878 - Support markdown comments --- Bugzilla/WebService/Bug.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Bugzilla/WebService') diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index feb541c2e..d14300f6f 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -362,7 +362,7 @@ sub render_comment { Bugzilla->switch_to_shadow_db(); my $bug = $params->{id} ? Bugzilla::Bug->check($params->{id}) : undef; - my $html = Bugzilla::Template::quoteUrls($params->{text}, $bug); + my $html = Bugzilla::Template::renderComment($params->{text}, $bug); return { html => $html }; } @@ -381,6 +381,7 @@ sub _translate_comment { time => $self->type('dateTime', $comment->creation_ts), creation_time => $self->type('dateTime', $comment->creation_ts), is_private => $self->type('boolean', $comment->is_private), + is_markdown => $self->type('boolean', $comment->is_markdown), text => $self->type('string', $comment->body_full), attachment_id => $self->type('int', $attach_id), count => $self->type('int', $comment->count), @@ -1112,9 +1113,11 @@ sub add_comment { if (defined $params->{private}) { $params->{is_private} = delete $params->{private}; } + # Append comment $bug->add_comment($comment, { isprivate => $params->{is_private}, - work_time => $params->{work_time} }); + work_time => $params->{work_time}, + is_markdown => 1 }); # Add comment tags $bug->set_all({ comment_tags => $params->{comment_tags} }) -- cgit v1.2.3-24-g4f1b