diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 3bb345a..0fdbf5e 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -46,6 +46,9 @@ class MarkdownConverter(object): text = (text or '').rstrip() return '%s\n%s\n\n' % (text, pad_char * len(text)) if text else '' + def convert_em(self, el): + return '_%s_' % el.text if el.text else '' + def convert_h1(self, el): return self.underline(el.text, '=') diff --git a/tests.py b/tests.py index 5cb370d..f3f8d38 100644 --- a/tests.py +++ b/tests.py @@ -16,6 +16,9 @@ class BasicTests(unittest.TestCase): class ConversionTests(unittest.TestCase): + def test_em(self): + self.assertEqual(md('Hello'), '_Hello_') + def test_h1(self): self.assertEqual(md('