Skip to content

Commit 6f699a1

Browse files
authored
Merge pull request #975 from cmccandless/markdown-fix-list-items
markdown: Do not add <p> to list items
2 parents 6e8fc0e + f97b6fc commit 6f699a1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

exercises/markdown/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def parse_line(line, in_list):
6666
if not re.match('<h|<ul|<li', res):
6767
res = wrap(res, 'p')
6868

69-
if not re.match('(<ul>)?<li>_(.*)', res):
69+
if list_match is None:
7070
res = re.sub('(.*)(<li>)(.*)(</li>)(.*)', r'\1\2<p>\3</p>\4\5', res)
7171

7272
while check_bold(res):

exercises/markdown/markdown_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from markdown import parse_markdown
33

44

5-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
5+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
66

77

88
class TestMarkdown(unittest.TestCase):
@@ -37,8 +37,8 @@ def test_h6(self):
3737

3838
def test_unordered_lists(self):
3939
self.assertEqual(parse_markdown('* Item 1\n* Item 2'),
40-
'<ul><li><p>Item 1</p></li>'
41-
'<li><p>Item 2</p></li></ul>')
40+
'<ul><li>Item 1</li>'
41+
'<li>Item 2</li></ul>')
4242

4343
def test_little_bit_of_everything(self):
4444
self.assertEqual(parse_markdown(

0 commit comments

Comments
 (0)