diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 51c1b3d..5c22c8a 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -43,8 +43,10 @@ class MarkdownConverter(object): text += tail - node.clear() + while len(node): + del node[0] node.text = text + node.tail = '' def __getattr__(self, attr): # Handle heading levels > 2