p tag conversion
This commit is contained in:
@@ -91,6 +91,9 @@ class MarkdownConverter(object):
|
||||
bullet = '*'
|
||||
return '%s %s\n' % (bullet, el.text or '')
|
||||
|
||||
def convert_p(self, el):
|
||||
return '%s\n\n' % el.text if el.text else ''
|
||||
|
||||
def convert_strong(self, el):
|
||||
return '**%s**' % el.text if el.text else ''
|
||||
|
||||
|
||||
3
tests.py
3
tests.py
@@ -38,6 +38,9 @@ class ConversionTests(unittest.TestCase):
|
||||
def test_ol(self):
|
||||
self.assertEqual(md('<ol><li>a</li><li>b</li></ol>'), '1. a\n2. b\n')
|
||||
|
||||
def test_p(self):
|
||||
self.assertEqual(md('<p>hello</p>'), 'hello\n\n')
|
||||
|
||||
def test_strong(self):
|
||||
self.assertEqual(md('<strong>Hello</strong>'), '**Hello**')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user