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/blockprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,16 @@ def test(self, parent, block):

def run(self, parent, blocks):
block = blocks.pop(0)
match = self.match
# Check for lines in block before hr.
prelines = block[:self.match.start()].rstrip('\n')
prelines = block[:match.start()].rstrip('\n')
if prelines:
# Recursively parse lines before hr so they get parsed first.
self.parser.parseBlocks(parent, [prelines])
# create hr
util.etree.SubElement(parent, 'hr')
# check for lines in block after hr.
postlines = block[self.match.end():].lstrip('\n')
postlines = block[match.end():].lstrip('\n')
if postlines:
# Add lines after hr to master blocks for later parsing.
blocks.insert(0, postlines)
Expand Down
9 changes: 9 additions & 0 deletions tests/misc/blockquote-hr.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@
Even a lazy line.</p>
<hr />
<p>The last line.</p>
</blockquote>
<p>foo</p>
<blockquote>
<p>bar</p>
<hr />
</blockquote>
<hr />
<blockquote>
<p>baz</p>
</blockquote>
6 changes: 6 additions & 0 deletions tests/misc/blockquote-hr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ Even a lazy line.
> ---

> The last line.

foo
> bar
> ***
---
> baz