diff --git a/lib/markdown2.py b/lib/markdown2.py index f3e41cc1..61bb6f69 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -1926,9 +1926,9 @@ def _do_code_blocks(self, text): _fenced_code_block_re = re.compile(r''' (?:\n+|\A\n?) - ^```\s{0,2}([\w+-]+)?\s*?\n # opening fence, $1 = optional lang - (.*?) # $2 = code block content - ^```[ \t]*\n # closing fence + ^```\s{0,2}([\w+-]+)?\s*?\n # opening fence, $1 = optional lang + (.*?) # $2 = code block content + ^```[ \t]*\n # closing fence ''', re.M | re.X | re.S) def _fenced_code_block_sub(self, match):