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
5 changes: 3 additions & 2 deletions markdown/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ 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
placeholder = self.markdown.htmlStash.store('\n\n'.join(
items[i:right_listindex + 1]))
del items[i:right_listindex + 1]
items[i:right_listindex + offset]))
del items[i:right_listindex + offset]
items.insert(i, placeholder)
return items

Expand Down
13 changes: 10 additions & 3 deletions tests/extensions/extra/raw-html.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@
Raw html blocks may also be nested.
</div>



</div>
<p>This text is after the markdown in html.</p>
<div name="issue308">
<p><span>1</span>
<span>2</span></p>
</div>
</div>
<div name="issue368">
<p>Markdown is <em>active</em> here.</p>
<div name="RawHtml">
Raw html blocks may also be nested.
</div>

<p>Markdown is <em>still</em> active here.</p>
</div>
<p>Markdown is <em>active again</em> here.</p>
14 changes: 14 additions & 0 deletions tests/extensions/extra/raw-html.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,17 @@ This text is after the markdown in html.
<span>2</span>

</div>

<div markdown="1" name="issue368">

Markdown is *active* here.

<div name="RawHtml">
Raw html blocks may also be nested.
</div>

Markdown is *still* active here.

</div>

Markdown is *active again* here.