summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Markdown.pm
diff options
context:
space:
mode:
authorKoosha KM <koosha.khajeh@gmail.com>2014-10-14 22:42:46 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-10-14 22:42:46 +0200
commit42d5e45576b519f19879d2b0eba529932da81644 (patch)
treefc6a2aafc38c1d2aa6ebf0ab1453827893107886 /Bugzilla/Markdown.pm
parent847191ac9f29dee98088203d2ac135b9d820b507 (diff)
downloadbugzilla-42d5e45576b519f19879d2b0eba529932da81644.tar.gz
bugzilla-42d5e45576b519f19879d2b0eba529932da81644.tar.xz
Bug 1059723: Reply button should become AJAX-based
r=dkl,a=sgreen
Diffstat (limited to 'Bugzilla/Markdown.pm')
-rw-r--r--Bugzilla/Markdown.pm32
1 files changed, 31 insertions, 1 deletions
diff --git a/Bugzilla/Markdown.pm b/Bugzilla/Markdown.pm
index 5f1a7d955..3023d98e2 100644
--- a/Bugzilla/Markdown.pm
+++ b/Bugzilla/Markdown.pm
@@ -75,7 +75,7 @@ sub _Markdown {
my $self = shift;
my $text = shift;
- $text = Bugzilla::Template::quoteUrls($text);
+ $text = Bugzilla::Template::quoteUrls($text, undef, undef, undef, undef, 1);
return $self->SUPER::_Markdown($text, @_);
}
@@ -392,6 +392,36 @@ sub _DoCodeBlocks {
return $text;
}
+sub _DoBlockQuotes {
+ my ($self, $text) = @_;
+
+ $text =~ s{
+ ( # Wrap whole match in $1
+ (?:
+ ^[ \t]*&gt;[ \t]? # '>' at the start of a line
+ .+\n # rest of the first line
+ (?:.+\n)* # subsequent consecutive lines
+ \n* # blanks
+ )+
+ )
+ }{
+ my $bq = $1;
+ $bq =~ s/^[ \t]*&gt;[ \t]?//gm; # trim one level of quoting
+ $bq =~ s/^[ \t]+$//mg; # trim whitespace-only lines
+ $bq = $self->_RunBlockGamut($bq, {wrap_in_p_tags => 1}); # recurse
+ $bq =~ s/^/ /mg;
+ # These leading spaces screw with <pre> content, so we need to fix that:
+ $bq =~ s{(\s*<pre>.+?</pre>)}{
+ my $pre = $1;
+ $pre =~ s/^ //mg;
+ $pre;
+ }egs;
+ "<blockquote>\n$bq\n</blockquote>\n\n";
+ }egmx;
+
+ return $text;
+}
+
sub _EncodeCode {
my ($self, $text) = @_;