From 0748e8411232181e3a769a5f3a3b60ad98239777 Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Fri, 13 May 2016 21:17:07 +0200 Subject: Bug 1208947 - Comment links in markdown-based emails are incomplete r=LpSolit --- Bugzilla/Markdown.pm | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'Bugzilla/Markdown.pm') diff --git a/Bugzilla/Markdown.pm b/Bugzilla/Markdown.pm index a82e9f3e0..2951cd457 100644 --- a/Bugzilla/Markdown.pm +++ b/Bugzilla/Markdown.pm @@ -55,33 +55,27 @@ $g_escape_table{'<'} = md5_hex('<'); sub new { my $invocant = shift; my $class = ref $invocant || $invocant; - return $class->SUPER::new(tab_width => MARKDOWN_TAB_WIDTH, + my $obj = $class->SUPER::new(tab_width => MARKDOWN_TAB_WIDTH, # Bugzilla uses HTML not XHTML empty_element_suffix => '>'); + $obj->{tab_width} = MARKDOWN_TAB_WIDTH; + $obj->{empty_element_suffix} = '>'; + return $obj; } sub markdown { - my $self = shift; - my $text = shift; + my ($self, $text, $bug, $comment) = @_; my $user = Bugzilla->user; if ($user->settings->{use_markdown}->{is_enabled} && $user->setting('use_markdown') eq 'on') { - return $self->SUPER::markdown($text, @_); + $text = $self->_removeFencedCodeBlocks($text); + $text = Bugzilla::Template::quoteUrls($text, $bug, $comment, $user, 1); + return $self->SUPER::markdown($text); } - return Bugzilla::Template::quoteUrls($text); -} - -sub _Markdown { - my $self = shift; - my $text = shift; - - $text = $self->_removeFencedCodeBlocks($text); - $text = Bugzilla::Template::quoteUrls($text, undef, undef, undef, 1); - - return $self->SUPER::_Markdown($text, @_); + return Bugzilla::Template::quoteUrls($text, $bug, $comment, $user); } sub _code_blocks { -- cgit v1.2.3-24-g4f1b