From 044615eff10a16edd80fad93a0c86bb52ec30fb0 Mon Sep 17 00:00:00 2001 From: Viktor Hozhyi Date: Sat, 4 Sep 2021 12:39:30 +0300 Subject: [PATCH] Fixed issue #52 - added stripping of text to list --- markdownify/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 3d67a49..4d36bd6 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -314,7 +314,7 @@ class MarkdownConverter(object): el = el.parent bullets = self.options['bullets'] bullet = bullets[depth % len(bullets)] - return '%s %s\n' % (bullet, text or '') + return '%s %s\n' % (bullet, (text or '').strip()) def convert_p(self, el, text, convert_as_inline): if convert_as_inline: