Index: readme/class-parser.php
===================================================================
--- readme/class-parser.php	(revision 7290)
+++ readme/class-parser.php	(working copy)
@@ -619,44 +619,57 @@ class Parser {
 		$trimmed_lines = array_map( 'trim', $lines );
 
 		/*
 		 * The heading style being matched in the block. Can be 'heading' or 'bold'.
 		 * Standard Markdown headings (## .. and == ... ==) are used, but if none are present.
 		 * full line bolding will be used as a heading style.
 		 */
 		$heading_style = 'bold'; // 'heading' or 'bold'
 		foreach ( $trimmed_lines as $trimmed ) {
 			if ( $trimmed && ( $trimmed[0] == '#' || $trimmed[0] == '=' ) ) {
 				$heading_style = 'heading';
 				break;
 			}
 		}
 
+		$in_code_block = false;
 		$line_count = count( $lines );
 		for ( $i = 0; $i < $line_count; $i++ ) {
 			$line    = &$lines[ $i ];
 			$trimmed = &$trimmed_lines[ $i ];
 			if ( ! $trimmed ) {
 				$value .= "\n";
 				continue;
 			}
 
+			if ( ! $in_code_block && '`' == $trimmed[0] && strlen( $trimmed ) > 1 && '`' != substr( $trimmed, -1 ) ) {
+				// Line started with ` and doesn't end with `, so we're entering a code block
+				$in_code_block = true;
+			} elseif ( $in_code_block && ( '`' == $trimmed[0] || '`' == substr( $trimmed, -1 ) ) ) {
+				// In a code block, and either the line starts with `, or ends with it, which indiates end of block.
+				$in_code_block = false;
+			}
+
 			$is_heading = false;
-			if ( 'heading' == $heading_style && ( $trimmed[0] == '#' || $trimmed[0] == '=' ) ) {
-				$is_heading = true;
-			} elseif ( 'bold' == $heading_style && ( substr( $trimmed, 0, 2 ) == '**' && substr( $trimmed, -2 ) == '**' ) ) {
-				$is_heading = true;
+			if ( ! $in_code_block ) {
+				if ( 'heading' == $heading_style && ( $trimmed[0] == '#' || $trimmed[0] == '=' ) ) {
+					$is_heading = true;
+				} elseif ( 'bold' == $heading_style && ( substr( $trimmed, 0, 2 ) == '**' && substr( $trimmed, -2 ) == '**' ) ) {
+					$is_heading = true;
+				}
 			}
 
 			if ( $is_heading ) {
 				if ( $value ) {
 					$return[ $key ] = trim( $value );
 				}
 
 				$value = '';
 				// Trim off the first character of the line, as we know that's the heading style we're expecting to remove.
 				$key = trim( $line, $trimmed[0] . " \t" );
 				continue;
 			}
 
 			$value .= $line . "\n";
 		}
Index: class-markdown.php
===================================================================
--- class-markdown.php	(revision 7290)
+++ class-markdown.php	(working copy)
@@ -1,20 +1,20 @@
 <?php
 namespace WordPressdotorg\Plugin_Directory;
 
 if ( ! class_exists( '\Michelf\MarkdownExtra' ) ) {
-	include __DIR__ . '/libs/michelf-php-markdown-1.6.0/Michelf/MarkdownExtra.inc.php';
+	include __DIR__ . '/libs/michelf-php-markdown-1.8.0/Michelf/MarkdownExtra.inc.php';
 }
 
 /**
  * WordPress.org Plugin Readme Parser Markdown.
  *
  * Relies on \Michaelf\Markdown_Extra
  *
  * @package WordPressdotorg\Plugin_Directory
  */
 class Markdown extends \Michelf\MarkdownExtra {
 
 	/**
 	 * @param string $text
 	 * @return string
 	 */
@@ -45,32 +45,35 @@ class Markdown extends \Michelf\Markdown
 		$text = str_replace( array( "\r\n", "\r" ), "\n", $text );
 
 		// Markdown can do inline code, we convert bbPress style block level code to Markdown style.
 		$text = preg_replace_callback( "!(^|\n)([ \t]*?)`(.*?)`!s", array( $this, 'code_trick_indent_cb' ), $text );
 
 		return $text;
 	}
 
 	/**
 	 * @access protected
 	 *
 	 * @param array $matches
 	 * @return string
 	 */
 	protected function code_trick_indent_cb( $matches ) {
+
 		$text = $matches[3];
-		$text = preg_replace( '|^|m', $matches[2] . '    ', $text );
+//		$text = preg_replace( '|^|m', $matches[2] . '    ', $text );
+$text = $matches[2] . '<pre><code>' . esc_html( $text ) . '</code></pre>';
+//	var_dump([ __METHOD__, $matches, $matches[1] . $text ]);
 
 		return $matches[1] . $text;
 	}
 
 	/**
 	 * @access protected
 	 *
 	 * @param array $matches
 	 * @return string
 	 */
 	protected function code_trick_decodeit_cb( $matches ) {
 		$trans_table = array_flip( get_html_translation_table( HTML_ENTITIES ) );
 
 		$text = $matches[2];
 		$text = strtr( $text, $trans_table );
