diff --git a/composer.json b/composer.json index f7a4f75..a9bb629 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name" : "nazar-pc/php-markdown-next", - "version" : "2.0.1", + "version" : "2.0.2", "type" : "library", "description" : "PHP Markdown Next", "homepage" : "https://github.com/nazar-pc/php-markdown-next", diff --git a/src/nazarpc/MarkdownNext.php b/src/nazarpc/MarkdownNext.php index bc3578f..669dc60 100644 --- a/src/nazarpc/MarkdownNext.php +++ b/src/nazarpc/MarkdownNext.php @@ -43,10 +43,13 @@ class MarkdownNext { static function defaultTransform ($text) { static $parser_list; // Try to take parser from the static parser list. + /** + * @var self $parser + */ $parser = &$parser_list[get_called_class()]; // Create the parser it not already set. if (!$parser) { - $parser = new static; + $parser = new self; } // Transform text using parser. return $parser->transform($text); @@ -633,7 +636,7 @@ protected function _hashHTMLBlocks_inMarkdown ($text, $indent = 0, $enclosing_ta /** * Check for: Code span marker */ - if ($tag[0] == "`") { + if ($tag[0] == '`' && $tag[1] !== '`') { // Find corresponding end marker. $tag_re = preg_quote($tag); if (preg_match( @@ -1818,7 +1821,6 @@ protected function doFencedCodeBlocks ($text) { '.$this->id_class_attr_catch_re.' # 3: Extra attributes )? [ ]* \n # Whitespace and newline following marker. - # 4: Content ( (?> @@ -1826,7 +1828,6 @@ protected function doFencedCodeBlocks ($text) { .*\n+ )+ ) - # Closing marker. \1 [ ]* \n }xm',