Skip to content

Commit

Permalink
Fix #580
Browse files Browse the repository at this point in the history
  • Loading branch information
Crozzers committed May 27, 2024
1 parent e0baec2 commit 5d1bfd2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/markdown2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ def sub(self, match):

tags = self.tags(lexer_name)

return "\n%s%s%s\n%s\n" % (leading_indent, tags[0], codeblock, tags[1])
return "\n%s%s%s\n%s%s\n" % (leading_indent, tags[0], codeblock, leading_indent, tags[1])

def run(self, text):
return self.fenced_code_block_re.sub(self.sub, text)
Expand Down
13 changes: 13 additions & 0 deletions test/tm-cases/fenced_code_blocks_simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,16 @@

<pre><code> is indentation maintained?
</code></pre>

<p>Here's one in a list, with another one following (see #580):</p>

<ul>
<li>List 1
<pre><code>code 1

code 2
</code></pre></li>
</ul>

<pre><code>code 3
</code></pre>
13 changes: 13 additions & 0 deletions test/tm-cases/fenced_code_blocks_simple.text
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ Here is one at the end of the file:
```
is indentation maintained?
```

Here's one in a list, with another one following (see #580):

* List 1
```
code 1

code 2
```

```
code 3
```

0 comments on commit 5d1bfd2

Please sign in to comment.