fixed nested lists and wrote correct tests

nested lists did not work: after a nested list was over,
a new line was inserted. this leads to a large gap before
the rest of the parent list.

lists are prefixed and suffixed with a single newline,
this is now represented in the tests.
This commit is contained in:
AlexVonB
2020-08-09 21:11:16 +02:00
parent ee73d89879
commit b747378b52
2 changed files with 9 additions and 8 deletions

View File

@@ -169,7 +169,8 @@ class MarkdownConverter(object):
break
el = el.parent
if nested:
text = '\n' + self.indent(text, 1)
# remove trailing newline if nested
return '\n' + self.indent(text, 1).rstrip()
return '\n' + text + '\n'
convert_ul = convert_list