Skip to content

Commit

Permalink
Merge pull request #408 from BarkeH/master
Browse files Browse the repository at this point in the history
Fix for fenced code blocks issue #396
  • Loading branch information
nicholasserra committed Sep 28, 2021
2 parents 9a92311 + e28fc46 commit 1b6cb85
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/markdown2.py
Expand Up @@ -1929,7 +1929,7 @@ def _do_code_blocks(self, text):

_fenced_code_block_re = re.compile(r'''
(?:\n+|\A\n?)
^```\s{0,99}([\w+-]+)?\s{0,99}\n # opening fence, $1 = optional lang
^```\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)
Expand Down
4 changes: 4 additions & 0 deletions test/tm-cases/fenced_code_blocks_issue396.html
@@ -0,0 +1,4 @@
<pre><code>a
b
c
</code></pre>
1 change: 1 addition & 0 deletions test/tm-cases/fenced_code_blocks_issue396.opts
@@ -0,0 +1 @@
{"extras": ["fenced-code-blocks"]}
5 changes: 5 additions & 0 deletions test/tm-cases/fenced_code_blocks_issue396.text
@@ -0,0 +1,5 @@
```
a
b
c
```

0 comments on commit 1b6cb85

Please sign in to comment.