added support for nested lists and paragraphs in a list