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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/change_log/release-3.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The following new features have been included in the 3.3 release:

The following bug fixes are included in the 3.3 release:

* Fix HR which follows strong em (#897).
* Support short reference image links (#894).
* Avoid a `RecursionError` from deeply nested blockquotes (#799).
* Fix issues with complex emphasis (#979).
Expand Down
2 changes: 1 addition & 1 deletion markdown/blockprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def run(self, parent, blocks):
class HRProcessor(BlockProcessor):
""" Process Horizontal Rules. """

RE = r'^[ ]{0,3}((-+[ ]{0,2}){3,}|(_+[ ]{0,2}){3,}|(\*+[ ]{0,2}){3,})[ ]*'
RE = r'^[ ]{0,3}((-+[ ]{0,2}){3,}|(_+[ ]{0,2}){3,}|(\*+[ ]{0,2}){3,})[ ]*$'
# Detect hr on any line of a block.
SEARCH_RE = re.compile(RE, re.MULTILINE)

Expand Down
16 changes: 16 additions & 0 deletions tests/test_syntax/blocks/test_hr.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,22 @@ def test_hr_after_paragraph(self):
)
)

def test_hr_after_emstrong(self):
self.assertMarkdownRenders(
self.dedent(
"""
***text***
***
"""
),
self.dedent(
"""
<p><strong><em>text</em></strong></p>
<hr />
"""
)
)

def test_not_hr_2_asterisks(self):
self.assertMarkdownRenders(
'**',
Expand Down