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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user