]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1205415 - Markdown incorrectly parses BlockQuote inside a CodeBlock
authorAlbert Ting <altlist@gmail.com>
Fri, 20 May 2016 17:48:56 +0000 (13:48 -0400)
committerDylan Hardison <dylan@mozilla.com>
Fri, 20 May 2016 17:49:12 +0000 (13:49 -0400)
r=dylan

Bugzilla/Markdown.pm

index 2951cd4578ef876a057a24bc24b00c943b8eb6c0..72e788fd024f10e38766a74df4886a113c2ee564 100644 (file)
@@ -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 {
             "<blockquote class=\"markdown\">\n$bq\n</blockquote>\n\n";
         }egmx;
 
+    $text = $self->_DoDelayCodeBlocks($text);
     return $text;
 }