From c31aebb066b139549d237ac1ba4c5be4ee80c221 Mon Sep 17 00:00:00 2001 From: Matthew Tretter Date: Fri, 29 Jun 2012 13:23:18 -0400 Subject: [PATCH] p tag conversion --- markdownify/__init__.py | 3 +++ tests.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/markdownify/__init__.py b/markdownify/__init__.py index c5348a4..51c1b3d 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -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 '' diff --git a/tests.py b/tests.py index ef96b15..4e6bcbd 100644 --- a/tests.py +++ b/tests.py @@ -38,6 +38,9 @@ class ConversionTests(unittest.TestCase): def test_ol(self): self.assertEqual(md('
  1. a
  2. b
'), '1. a\n2. b\n') + def test_p(self): + self.assertEqual(md('

hello

'), 'hello\n\n') + def test_strong(self): self.assertEqual(md('Hello'), '**Hello**')