diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 5c008d3..c9bc9a2 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -148,7 +148,7 @@ class MarkdownConverter(object): if convert_as_inline: return text - return '\n' + line_beginning_re.sub('> ', text) if text else '' + return '\n' + (line_beginning_re.sub('> ', text) + '\n\n') if text else '' def convert_br(self, el, text, convert_as_inline): if convert_as_inline: diff --git a/tests/test_conversions.py b/tests/test_conversions.py index edaefbc..a32bf65 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -75,12 +75,16 @@ def test_b_spaces(): def test_blockquote(): - assert md('
Hello
').strip() == '> Hello' + assert md('
Hello
') == '\n> Hello\n\n' + + +def test_blockquote_with_paragraph(): + assert md('
Hello

handsome

') == '\n> Hello\n\nhandsome\n\n' def test_nested_blockquote(): - text = md('
And she was like
Hello
').strip() - assert text == '> And she was like \n> > Hello' + text = md('
And she was like
Hello
') + assert text == '\n> And she was like \n> > Hello\n> \n> \n\n' def test_br():