From: Albert Ting Date: Fri, 20 May 2016 17:48:56 +0000 (-0400) Subject: Bug 1205415 - Markdown incorrectly parses BlockQuote inside a CodeBlock X-Git-Tag: release-5.1.2~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d5c1cfdb12050176825b4e1e28808a708dea58b;p=thirdparty%2Fbugzilla.git Bug 1205415 - Markdown incorrectly parses BlockQuote inside a CodeBlock r=dylan --- diff --git a/Bugzilla/Markdown.pm b/Bugzilla/Markdown.pm index 2951cd4578..72e788fd02 100644 --- a/Bugzilla/Markdown.pm +++ b/Bugzilla/Markdown.pm @@ -420,10 +420,17 @@ sub _DoCodeSpans { return $text; } -# Override to add GFM Fenced Code Blocks +# Override to delay after DoBlockQuotes sub _DoCodeBlocks { my ($self, $text) = @_; + return $text; +} + +# add GFM Fenced Code Blocks +sub _DoDelayCodeBlocks { + my ($self, $text) = @_; + $text =~ s{ ^ (${\FENCED_BLOCK}|${\INDENTED_FENCED_BLOCK}) }{ @@ -469,6 +476,7 @@ sub _DoBlockQuotes { "
\n$bq\n
\n\n"; }egmx; + $text = $self->_DoDelayCodeBlocks($text); return $text; }