From d0f688d2e4e225b65da1d6745687f00b0ce839f6 Mon Sep 17 00:00:00 2001 From: AlexVonB Date: Thu, 4 Jul 2019 16:26:09 +0200 Subject: [PATCH 1/2] Add newline before and after a markdown list Fixes matthewwithanm#5 as well as an issue where `

foo

` gets converted to `foo * bar` which is not correct --- markdownify/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 12be28e..25608bf 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -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 From 5f9243d91d1484c0d0d6777cc408150fda6e2f94 Mon Sep 17 00:00:00 2001 From: AlexVonB Date: Thu, 4 Jul 2019 16:32:21 +0200 Subject: [PATCH 2/2] added tests for matthewwithanm#11 --- tests/test_conversions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_conversions.py b/tests/test_conversions.py index af4b54f..dfc8d3c 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -103,6 +103,9 @@ def test_strong(): def test_ul(): assert md('') == '* a\n* b\n' + +def test_inline_ul(): + assert md('

foo

bar

') == 'foo \n* a\n* b\n\nbar' def test_nested_uls():