From 5d5c1cfdb12050176825b4e1e28808a708dea58b Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Fri, 20 May 2016 13:48:56 -0400 Subject: Bug 1205415 - Markdown incorrectly parses BlockQuote inside a CodeBlock r=dylan --- Bugzilla/Markdown.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Markdown.pm b/Bugzilla/Markdown.pm index 2951cd457..72e788fd0 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; } -- cgit v1.2.3-24-g4f1b