diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 16b6c58..2c00015 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -79,6 +79,9 @@ class MarkdownConverter(object): def convert_b(self, el): return self.convert_strong(el) + def convert_br(self, el): + return ' \n' + def convert_em(self, el): return '*%s*' % el.text if el.text else '' diff --git a/tests.py b/tests.py index 3c9a9c0..d62627a 100644 --- a/tests.py +++ b/tests.py @@ -37,6 +37,9 @@ class ConversionTests(unittest.TestCase): def test_b(self): self.assertEqual(md('Hello'), '**Hello**') + def test_br(self): + self.assertEqual(md('a
b
c'), 'a \nb \nc') + def test_em(self): self.assertEqual(md('Hello'), '*Hello*')