Index: markdown.php
===================================================================
RCS file: /u/kim/.cvsroot/.www/php/markdown.php,v
retrieving revision 1.11
retrieving revision 1.13
diff -u -r1.11 -r1.13
--- markdown.php	7 Apr 2013 13:45:54 -0000	1.11
+++ markdown.php	23 Jun 2013 10:03:04 -0000	1.13
@@ -2635,6 +2635,7 @@
 				(?:\n|\A)
 				# 1: Opening marker
 				(
+					(?:>[ ]*)? # Blockquoted
 					~{3,} # Marker: three tilde or more.
 				)
 				[ ]*
@@ -2661,6 +2662,7 @@
 		return $text;
 	}
 	function _doFencedCodeBlocks_callback($matches) {
+		$marker    =& $matches[1];
 		$classname =& $matches[2];
 		$attrs     =& $matches[3];
 		$codeblock = $matches[4];
@@ -2678,6 +2680,9 @@
 		$pre_attr_str  = $this->code_attr_on_pre ? $attr_str : '';
 		$code_attr_str = $this->code_attr_on_pre ? '' : $attr_str;
 		$codeblock  = "<pre$pre_attr_str><code$code_attr_str>$codeblock</code></pre>";
+		if (preg_match('/>/', $marker)) {
+		    $codeblock = "<blockquote>$codeblock</blockquote>";
+		}
 		
 		return "\n\n".$this->hashBlock($codeblock)."\n\n";
 	}
