Skip to content

Commit

Permalink
Be forgiving
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasserra committed Jan 20, 2021
1 parent e1954d3 commit c4b4ccb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/markdown2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,99}([\w+-]+)?\s{0,99}\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):
Expand Down

0 comments on commit c4b4ccb

Please sign in to comment.