Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions markdown/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ def _nested_markdown_in_html(self, items):
else: # raw html
if len(items) - right_listindex <= 1: # last element
right_listindex -= 1
offset = 1 if i == right_listindex else 0
if right_listindex <= i:
right_listindex = i + 1
placeholder = self.markdown.htmlStash.store('\n\n'.join(
items[i:right_listindex + offset]))
del items[i:right_listindex + offset]
items[i:right_listindex]))
del items[i:right_listindex]
items.insert(i, placeholder)
return items

Expand Down
7 changes: 6 additions & 1 deletion tests/extensions/extra/raw-html.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@

<p>Markdown is <em>still</em> active here.</p>
</div>
<p>Markdown is <em>active again</em> here.</p>
<p>Markdown is <em>active again</em> here.</p>
<div>
<p>foo bar</p>
<p><em>bar</em>
</p>
</div>
6 changes: 6 additions & 0 deletions tests/extensions/extra/raw-html.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ Markdown is *still* active here.
</div>

Markdown is *active again* here.

<div markdown=1>
foo bar

<em>bar</em>
</div>