Merge pull request #11 from AlexVonB/AlexVonB-patch-1

Add newline before and after a markdown list
This commit is contained in:
Matthew Dapena-Tretter
2019-07-04 08:53:25 -07:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -153,7 +153,7 @@ class MarkdownConverter(object):
el = el.parent
if nested:
text = '\n' + self.indent(text, 1)
return text
return '\n' + text + '\n'
convert_ul = convert_list
convert_ol = convert_list

View File

@@ -103,6 +103,9 @@ def test_strong():
def test_ul():
assert md('<ul><li>a</li><li>b</li></ul>') == '* a\n* b\n'
def test_inline_ul():
assert md('<p>foo</p><ul><li>a</li><li>b</li></ul><p>bar</p>') == 'foo \n* a\n* b\n\nbar'
def test_nested_uls():