diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index 423f268..09b0c5a 100644 --- a/Michelf/MarkdownExtra.php +++ b/Michelf/MarkdownExtra.php @@ -1295,9 +1295,12 @@ class MarkdownExtra extends \Michelf\Markdown { (?:~{3,}|`{3,}) # 3 or more tildes/backticks. ) [ ]* - # #2: class name (optional) and #3: attributes (optional) (?: - \.?([-_:a-zA-Z0-9]+)?[ ]*('.$this->id_class_attr_catch_re.')? + \.?([-_:a-zA-Z0-9]+) # 2: standalone class name + )? + [ ]* + (?: + '.$this->id_class_attr_catch_re.' # 3: Extra attributes )? [ ]* \n # Whitespace and newline following marker. @@ -1319,7 +1322,7 @@ class MarkdownExtra extends \Michelf\Markdown { protected function _doFencedCodeBlocks_callback($matches) { $classname =& $matches[2]; $attrs =& $matches[3]; - $codeblock = $matches[5]; + $codeblock = $matches[4]; if ($this->code_block_content_func) { $codeblock = call_user_func($this->code_block_content_func, $codeblock, $classname);