i tag conversion

This commit is contained in:
Matthew Tretter
2012-06-29 12:50:37 -04:00
parent 77172ab3ba
commit 5220ac6ea2
2 changed files with 6 additions and 0 deletions

View File

@@ -55,6 +55,9 @@ class MarkdownConverter(object):
def convert_h2(self, el):
return self.underline(el.text, '-')
def convert_i(self, el):
return self.convert_em(el)
def markdownify(html, strip=None, keep=None):
converter = MarkdownConverter(strip, keep)

View File

@@ -24,3 +24,6 @@ class ConversionTests(unittest.TestCase):
def test_h2(self):
self.assertEqual(md('<h2>Hello</h2>'), 'Hello\n-----\n\n')
def test_i(self):
self.assertEqual(md('<i>Hello</i>'), '_Hello_')